Method for setting more precisely a position and/or orientation of a device head, which is connected to a robot arm mounted on a working platform, in a measuring environment by means of a distance measuring device, which comprises a number of M, M ≥ 1 distance measuring sensors and which is connected to the device head, and a control device, which is connected in a communicating manner to the distance measuring device and at least two on-board sensor devices (14, 19), wherein the position and/or orientation of the device head is determined by means of a first on-board sensor device and transmitted to the control device and a geometry model of the measuring environment is stored in the control device, characterized by a sequence of a first, second, third and fourth step, which is carried out N times, N ≥ 1, wherein: ▪ in the first step of the sequence, the device head is arranged in a measuring position (MP 1, MP 2, MP 3) in the measuring environment, and pose data are determined for the measuring position (MP 1, MP 2, MP 3), wherein the pose data for the measuring position (MP 1) of the first sequence are determined by means of the first on-board sensor device and the pose data for the measuring positions (MP 2, MP 3) of further sequences are determined by means of the first on-board sensor device and a further on-board sensor device, ▪ in the second step of the sequence, the distance measuring sensors carry out a distance measurement in relation to surfaces of the measuring environment and transmit their measured distance values (d m_ j1, d m_ j2, d m_ j3) to the control device, ▪ in the third step of the sequence, the geometry model and the pose data for the measuring position (MP 1, MP 2, MP 3) are used to determine estimated distance values (d e_ j1, d e_ j2, d e_ j3) corresponding to the measured distance values (d m_ j1, d m_ j2, d m_ j3), and ▪ in the fourth step of the sequence, the deviations (Δ j1, Δ j2, Δ j3) between the measured distance values (d m_ j1, d m_ j2, d m_ j3) and the corresponding estimated distance values (d e_ j1, d e_ j2, d e_ j3) are calculated and stored as error values (Δ j1, Δ j2, Δ j3), and after the Nth sequence of the first to fourth steps, the error values (Δ j1, Δ j2, Δ j3) are used to carry out an error minimization for the position and/or orientation of the device head and the position and/or orientation of the device head is set more precisely by the control device. ▪ in the first step of the sequence, the device head is arranged in a measuring position (MP 1, MP 2, MP 3) in the measuring environment, and pose data are determined for the measuring position (MP 1, MP 2, MP 3), wherein the pose data for the measuring position (MP 1) of the first sequence are determined by means of the first on-board sensor device and the pose data for the measuring positions (MP 2, MP 3) of further sequences are determined by means of the first on-board sensor device and a further on-board sensor device, ▪ in the second step of the sequence, the distance measuring sensors carry out a distance measurement in relation to surfaces of the measuring environment and transmit their measured distance values (d m_ j1, d m_ j2, d m_ j3) to the control device, ▪ in the third step of the sequence, the geometry model and the pose data for the measuring position (MP 1, MP 2, MP 3) are used to determine estimated distance values (d e_ j1, d e_ j2, d e_ j3) corresponding to the measured distance values (d m_ j1, d m_ j2, d m_ j3), and ▪ in the fourth step of the sequence, the deviations (Δ j1, Δ j2, Δ j3) between the measured distance values (d m_ j1, d m_ j2, d m_ j3) and the corresponding estimated distance values (d e_ j1, d e_ j2, d e_ j3) are calculated and stored as error values (Δ j1, Δ j2, Δ j3),