Most indoor positioning systems require calibration before use. Fingerprinting requires the construction of a signal strength map, while ranging systems need the coordinates of the beacons. Calibration approaches exist for positioning systems that use Wi-Fi, radio frequency identification or ultrawideband. However, few examples are available for the calibration of visible light positioning systems. Most works focused on obtaining the channel model parameters or performed a calibration based on known receiver locations. In this paper, we describe an improved procedure that uses a mobile robot for data collection and is able to obtain a map of the environment with the beacon locations and their identities. Compared to previous work, the error is almost halved. Additionally, this approach does not require prior knowledge of the number of light sources or the receiver location. We demonstrate that the system performs well under a wide range of lighting conditions and investigate the influence of parameters such as the robot trajectory, camera resolution and field of view. Finally, we also close the loop between calibration and positioning and show that our approach has similar or better accuracy than manual calibration.