A structured light system is used to position a scientific instrument mounted on a Mars rover robotic arm relative to a Mars surface sample. Fifty laser spots are projected on the Mars surface sample. The identification of individual laser spots, the centroiding algorithm and the calibration are discussed. Results show that the system measures the distance to the Mars surface sample more accurate than 50 microns at a nominal operating distance of 30 mm.