Landmine detection capability of metal detectors is very sensitive to the gap between buried landmines and the sensor heads. Therefore, human deminers manually scan ground surface with the metal detectors in such a manner that the sensor heads follow the ground surface. In case of robots assisted landmine detection, this function can be performed accurately and safely by controlling the gap and attitude of the sensor heads. In this investigation, the effectiveness of the gap and attitude control of the sensor head by some mechanical manipulator on the landmine detection performance has been addressed quantitatively. To this end, the paper describes the development of a Controlled Metal Detector (CMD) for controlling the gap and attitude of the sensor head. The CMD generates trajectories of the sensor head from the depth information of the ground surface acquired with 3D stereovision camera in order to avoid any obstacles and possible impact with the ground, and then tracks the trajectories with a trajectory-tracking controller. The effectiveness and the impact related to the gap and attitude control on the landmine detection performance of the CMD have been demonstrated by experimental studies.