Design and Development of an Automatic Layout Algorithm for Laser GNSS RTK

At the current stage, the automation level of GNSS RTK equipment is low, and manual operation leads to decreased accuracy and efficiency in setting out. To address these issues, this paper has designed an algorithm for automatic setting out that resolves the common problem of reduced accuracy in conventional RTK. First, the calculation of the laser rotation center is conducted using relevant parameters to calibrate the instrument’s posture and angle. Then, by analyzing the posture information, the relative position and direction of the instrument to the point to be set out are determined, and the rotation angles in the horizontal and vertical directions are calculated. Following this, the data results are analyzed, and the obtained rotation angles are output to achieve automatic control of the instrument. Finally, a rotating laser composed of servo motors and laser modules is used to control the GNSS RTK equipment to locate the set-out point, thereby determining its position on the ground and displaying it in real-time. Compared to traditional GNSS RTK equipment, the proposed automatic setting out algorithm and the developed GNSS laser RTK equipment reduce the setting out error from 15 mm to 10.3 mm. This reduces the barrier to using GNSS RTK equipment, minimizes human influence, enhances the work efficiency of setting out measurements, and ensures high efficiency and stability under complex conditions.


Introduction
High-precision positioning is a critical issue for many applications, such as machine control, drones, and mobile mapping.In outdoor environments, the Global Positioning System (GPS [1]) Real-Time Kinematic (RTK [2]) has been proven to be a reliable and efficient tool that can provide centimeter-level [3] positioning accuracy after resolving carrier phase integer ambiguities [4].Under open-sky conditions, the use of multi-GNSS receivers [5,6] can achieve rapid ambiguity resolution [7,8], but the high cost of multi-GNSS receivers makes many potential applications unfeasible.In the field of engineering measurement applications, pursuing cost-effective and precise solutions continues to be an important aspect of driving project development, especially in today's era of informational development, where RTK layout [9,10] is gradually becoming the mainstream layout mode.
RTK layout includes the principles of GNSS RTK positioning [11,12] by using GNSS RTK equipment [13,14] to transfer the points and lines from design drawings onto the ground to facilitate construction according to the designs.It is currently the main equipment for layout work, widely used in various engineering constructions.The current RTK layout methods include traditional RTK layout [15], RTK layout with inertial navigation [16,17], and AR image RTK layout [18,19].Although traditional RTK layout significantly reduces precision errors caused by manual calculations [20] and is easier to operate compared to total station layout, the process requires maintaining a vertical alignment of the RTK antenna phase center [21] with the alignment pole and the points to be laid out to correctly determine their positions.Manual use of the alignment pole [22] for point finding introduces errors due to human operation and results in low RTK layout efficiency.Especially since the real-time positioning error of RTK itself is generally around 1~2 cm, the tip of the centering pole approaches the layout point, and the distance between the pole tip and the layout point is within a few centimeters, the directional error [23] increases significantly as the distance decreases.It will be difficult to control the movement direction and slow the layout speed due to the impact on the layout accuracy.RTK layout with inertial navigation addresses the major issue of maintaining vertical alignment between the alignment pole and the layout points in traditional RTK layout, improving the efficiency of RTK layout to some extent, but it cannot solve the same issues that arise when the pole tip approaches the layout points in ordinary RTK layout.AR image [12] RTK layout represents the latest technology, based on the advantages of inertial navigation RTK layout.It does not require the use of an alignment pole to locate the layout points.Integrating machine vision technology [24,25], it can display the position of the layout points on the image in real time, significantly improving the speed and accuracy of measuring layout points.However, the issue with AR image RTK layout is that to ensure layout accuracy, it still requires moving the alignment pole, which has certain limitations.
To overcome the limitations of the current RTK layout method and meet new societal demands, this paper introduces a high-precision automatic layout computation method that integrates GNSS and inertial navigation systems (Figures 1 and 2).Initially, the method precisely calculates the rotation center of the laser to calibrate the instrument's orientation and angles, ensuring accurate measurement of the relative position and direction between the instrument and the setting-out points.Subsequently, the calculated rotation angles are converted into commands to drive the laser module via a servo motor, accurately guiding the GNSS RTK equipment to locate and mark the layout points.The innovation of this technique lies in its automation, which significantly reduces human error impacts, achieving rapid and precise marking of layout points, thereby enhancing efficiency and accuracy while simplifying operations.Moreover, this study meticulously records data collected from GNSS RTK devices and servo motor sensors, including positional coordinates and rotation angles, to ensure the accuracy and reliability of the results.This research not only provides practical technological solutions for professionals and non-professionals in the setting-out measurement field but also lays the groundwork for further development and innovation in the domain.

GNSS Laser RTK Calculation Principle
The laser module is mounted on a vertical servo motor, which is fixed together with a horizontal rotation motor.Two servo motors are installed on the GNSS RTK instrument.The alignment pole is marked with scales to determine the distance from the RTK phase center to the tip of the pole.Using GNSS RTK measurements, the coordinates of the RTK phase center are obtained along with the coordinates and inclination angles of the pole tip measured during calibration.These measurements are used to calculate the coordinates of the laser rotation center, the rotational angles between the vertical and horizontal directions of the point to be laid out, and the calibration direction.

IMU RTK Measurement Principles
Define the GNSS RTK phase center as a point A, the tip of the centering pole as a point O, and the distance from the RTK phase center to the tip of the centering pole as L. According to conventional layout, when a fixed solution is obtained by moving the RTK instrument left and right or walking a certain distance, inertial navigation is first initialized in order to convert the inertial heading angle to the geodetic azimuth value.
Let the RTK phase center coordinates be A(x A , y A , z A ).When the RTK is in any inclined state, there is an inclination angle between the centering pole and the ground.The posture of the GNSS RTK equipment is shown in Figure 3.It is necessary to perform a coordinate conversion for the coordinates of the tip of the centering pole.Assuming the phase center A as the origin of the inertial navigation coordinate system, with the measurement coordinate system being O − XYZ and the Euler angles corresponding to the inertial navigation attitude being roll angle, pitch angle, and yaw angle, represented by symbols γ, θ, and ψ, respectively, their three-axis rotation matrix is as follows: Rotation around the X-axis: Rotation around the Y-axis: Rotation around the Z-axis: The rotation matrix is: After the initialization of the RTK inertial navigation, the N-axis of the inertial navigation coordinate system corresponds to the X-axis of the measurement coordinate system.In the inertial coordinate system, the unit length coordinate increment from the phase center to the tip of the centering pole is: cos θ cos ψ sin γ sin θ cos ψ − cos γ sin ψ cos γ sin θ cos ψ + sin γ sin ψ cos θ sin ψ sin γ sin θ sin ψ + cos γ cos ψ cos γ sin θ sin ψ − sin γ cos ψ − sin θ sin γ cos θ cos γ cos θ Taking into account the conversion relationship between the unit length coordinate increments in the inertial coordinate system and the measurement coordinate system [δPx, δPy, δPz], it has: Let the distance of any point along the direction from the antenna phase center point A to the tip of the centering pole be L.The coordinate increment from the antenna phase center point A to the tip of the centering pole point O can be determined as follows: Thus, the three-dimensional coordinates of a point O can be obtained in real time.

Laser Beam and Motor Assembly System Calibration
As shown in Figure 4, the horizontal rotation motor (green area) and the vertical rotation motor (light blue area) are integrated with the laser (orange area) in a specific arrangement.The horizontal motor is integrated onto the GNSS RTK instrument, with its rotation axis aligned with the alignment pole axis.The vertical rotation motor is attached below the horizontal motor using a mounting bracket, with its rotation axis perpendicular to the horizontal rotation axis.The laser device is mounted on the vertical rotation motor, set to emit in a direction perpendicular to the vertical rotation axis, ensuring that the direction of the laser emission is parallel to the axis of the alignment pole.
After initial alignment [26] is completed, the alignment pole is positioned vertically, putting the system in a plumb state (Figure 5).The laser is directed to align with a known coordinate point Q x Q , y Q , z Q on the ground.The real-time ground coordinates of the phase center point A and the tip of the alignment pole O are (x A , y A , z A ) and (x O , y O , z O ), respectively.At this time, the roll angle and pitch angle are close to zero, and the heading angle is ψ.OA is the length from the phase center point A to the ground, and L ′ is the distance from the phase center point A along the direction of the alignment pole tip to the laser rotation point S.  Since the rotational range of 0 to 180 degrees for the horizontal rotation motor sufficiently meets the practical application needs during the overall structural design of the device, it is specified that when the internal motor of the instrument rotates within this designated angle range, the real-time coordinates of the laser rotation point are S = (x S , y S , z S ), and the yaw angle rotation matrix is: In Figure 6, ∆x and ∆y are the offsets of the laser rotation point S from the RTK phase center point A when the instrument is in its internal limit position.The length of L ′ can be determined from the positional relationship between point S and point A. By substituting into the rotation matrix R Z (ψ), the three-dimensional coordinates of the laser rotation point S = (x S , y S , z S ) can be obtained: The azimuth angle of OQ can be derived as follows: The angle between the laser direction and the vertical line is expressed as follows: At this time, the angles of the horizontal and vertical motors are set according to the aforementioned azimuth and tilt angles.The rotation direction of the laser, using the vertical motor's axis as a reference, is positive when rotating clockwise and negative when rotating counterclockwise.Considering that the layout point is generally within a few centimeters from the centering pole, the angle of the vertical motor relative to the horizontal motor can typically be controlled within a range of about ±10 • to meet practical application needs effectively.
Theoretically, larger angles could be used, but considering that in actual staking work, the centering pole needs to be as close as possible to the stakeout point, and the staking accuracy decreases as the distance between the centering pole and the stakeout point increases, an angle of ±10 • is already sufficient given that the centering pole is usually around 1.8 m.

The Angle of Inclination of the Centering Rod in Any State
Based on the coordinates of the tip of the alignment pole and the instrument's roll, pitch, and heading angles, the inclination of the alignment pole relative to the ground can be calculated (Figure 7).From Equation ( 5), the correction amounts for unit length coordinates in three axes can be obtained.Multiplying these three unit length coordinate corrections by the RTK alignment pole length L yields the projected lengths along the respective axes.Let the inclination angle of the pole be β, and the azimuth angle from the phase center projected onto the ground to the direction of the pole tip be α.

Principle of Motor Rotation Angle Calculation
When the alignment pole is in a tilted position, the rotation plane of the horizontal motor always aligns with the inclined plane of the RTK phase center; therefore, the normal vector of the horizontal motor's rotation plane should be the normal vector of the RTK phase center's inclined plane.
As shown in Figure 8, the diagram illustrates the motor rotation point relationship: • Plane ρ is the horizontal plane, and plane λ is an inclined plane.• OA represents the rotation axis of the alignment pole in any state, with its direction vector.

•
Point O ′ is the intersection perpendicular to OA through the laser rotation point, with a known length r. • A circle with radius r centered at a point O ′ lies on a plane λ.

•
Point P is the point to be laid out with known specific coordinates; a perpendicular from point P to the plane λ intersects at point P ′ .

•
Point K is the intersection of O ′ P ′ and the laser rotation radius, where O ′ P ′ intersects with ⊙O ′ at point K. • Through point P ′ , tangents from point P ′ to ⊙O ′ are drawn at points U and V, and perpendiculars from points U and V to plane ρ intersect at points M and N, respectively.The coordinates and orientation of the RTK phase center A(x A , y A , z A ) can be obtained in real time.The coordinates and orientation of the perpendicular intersection point O ′ (x o ′ , y o ′ , z o ′ ) with the axis of the alignment pole can also be acquired in real time.By calculating the tip of the alignment pole O and the RTK phase center point A, the unit vector of OA is obtained as (dpx, dpy, dpz).Therefore, the three-dimensional coordinates of the point O ′ are expressed as follows: P(x P , y P , z P ) is the ground point to be laid out.From Equation (8), the coordinates of the point O(x O , y O , z O ) are known.The equation for plane λ, which passes through O ′ and is perpendicular to the alignment pole: With the substitutions of A = dpx, B = dpy, and C = dpz, Equation ( 17) can be written as: D = −(AX ′ + BY ′ + CZ ′ ); the above equation can be obtained the following way: The coordinates of the point P(x P , y P , z P ) on an inclined plane λ, which is perpendicu- lar to the ground point P ′ = (x P ′ , y P ′ , z P ′ ), are expressed as follows: The length of O ′ P ′ : → Calculate the azimuth angle of the horizontal motor rotation: U and V are the tangent points on the circular path of the horizontal motor through P ′ .If the laser point is to precisely land on the layout point P, the horizontal motor needs to rotate to this position.Here, P ′ U⊥O ′ U, P ′ V⊥O ′ V, and On this inclined plane, by rotating the vector → O ′ K by ±φ degrees, the spatial positions of points U and V where the laser rotation point needs to move can be obtained.A, B, C) be the normal vectors of the plane λ.Using Rodrigues' rotation formula [27].For space vectors, the coordinates of the two tangent points can be calculated:

Let the vectors
where point U rotates counterclockwise by θ degrees and point V rotates clockwise by θ degrees. Vectors according to the coordinates of the tangent points, can have their azimuth angles to the point O ′ calculated.These represent the horizontal rotation angles of the motor.
When rotating the motor, it can be set to rotate to the position that has the smallest angular difference from the current motor position (azimuth).If the motor rotates to point U, let the vertical motor's tilt rotation angle be τ, which is equal to the angle between and the unit vector i = (0, 0, 1).

Example Verification
Perform data validation for the GNSS Laser RTK fusion algorithm, obtaining RTK attitude data and the coordinates of the point to be laid out in any inclined state to calculate the horizontal and vertical rotation angles of the motor.The steps are as follows: 1.
Obtain the RTK phase center coordinates and the coordinates of the point to be laid out based on the RTK attitude, with related data shown in Table 1.

2.
After initialization, the IMU attitude (in radians) is expressed as follows: The phase center height is 1.800 m, and the starting position of the laser rotation point relative to the phase center design is (−0.046,0, −0.058).

3.
Coordinates of the pole tip O and point O ′ are shown in Table 2.

5.
Calculate the coordinates of the intersection point P ′ perpendicular to the inclined plane through the ground point P; compute the length of O ′ P ′ as well as the azimuth angle α O ′ P ′ of the horizontal motor rotation.Relevant data are shown in Tables 3 and 4.

6.
Coordinates of points U and V are shown in Table 5.

7.
The values for the horizontal motor angle and the vertical motor tilt angle are as follows, with relevant data shown below, see Table 6: Table 6.Rotation angle of horizontal motor and tilt rotation angle of vertical motor.

Error Analysis
Considering the effects of inertial navigation on attitude errors, installation errors, etc., the following analysis examines the impact of these errors on the laser rotation point.

Effect of Laser Rotation Point Error
The design coordinates of the laser rotation point S relative to the phase center A(x 0 , y 0 , z 0 ) be S(∆x, ∆y, ∆z), then the real-time three-dimensional coordinates of S: Expand the above formula to obtain: x S = ∆x cos θ cos ψ + ∆y(cos γ sin ψ + sin γ sin θ cos ψ) + ∆z(cos γ sin θ cos ψ − sin γ sin ψ) + x 0 y S = ∆x cos θ sin ψ + ∆y(sin γ sin θ sin ψ − cos γ cos ψ) + ∆z(sin γ cos ψ + cos γ sin θ sin ψ) + y 0 z S = ∆x sin θ − ∆y sin γ cos θ − ∆z cos γ cos θ + y 0 (38) The impact of the component design coordinates S(∆x, ∆y, ∆z) along with production and installation errors, set this fixed error to M g = ±1.5 mm.Assuming that the error of the RTK phase center coordinates themselves is not considered.According to the law of error propagation [28], it can be obtained: Since the impact of the error at the laser rotation point is independent of the magnitude of the heading angle, cos ψ can be set to 1 and sin ψ to 0. The above formula can be simplified to: The coordinate error of the laser rotation point relative to the phase center: Typically, ∆x = ∆y = 0.05m, ∆z = 0.10m, m γ = m θ = 0.05 ∼ 0.1 • , and m ψ = 0.2 ∼ 1.0 • are used for calculations.Some of the calculated results are as follows: (1) and the average error obtained is ±1.55 mm (Figure 9).( and the average error obtained is ±2.35 mm (Figure 10).( and the average error obtained is ±1.56 mm (Figure 11).( and the average error obtained is ±2.36 mm (Figure 12).When ∆x = ∆y = 0 and ∆z = 1.8 m, the calculation formula for the measurement error of conventional inertial RTK tilt sampling using a pole can be applied.The error distribution diagram is as follows: (1) and the average error obtained is ±3.51 mm (Figure 13).( and the average error obtained is ±11.40 mm (Figure 14).( and the average error obtained is ±5.15 mm (Figure 15).( and the average error obtained is ±12.11mm (Figure 16).From the above Figure, it is evident that during conventional inertial RTK layout measurements using an alignment pole, the inclination angle of the pole is generally within 10 • .Therefore, the coordinate error M S of the pole tip caused by errors such as attitude angles is approximately ±10 mm, and the error M L due to moving the alignment pole to the point is generally around ±5 mm.Considering that the real-time coordinate error of the RTK phase center is generally within ±( 5 ∼ 15) mm, with M A taken as ±10 mm, the coordinate error for conventional inertial RTK layout is:

Effect of Motor Rotation Error
Based on the scheme described in the document and illustrated in the diagram, during laser RTK automatic sampling: The pole tilt angle is represented by β.
The laser rotation point is denoted as S(x S , y S , z S ).
The azimuth angle of the horizontal rotation motor is α QS ′ = α.The rotation angle of the vertical rotation motor is τ.
The actual sampling point's position is denoted as P(x P , y P , z P ).
The motor rotation angle errors be m τ = m γ = m ′ .S ′ represents the projection of S onto the horizontal plane, and its coordinates are (x S ′ , y S ′ , z S ′ ).
From Figure 17, that the following can be obtained: Since sin(α + 90 • ) = sin(α − 270 • ) and cos(α + 90 • ) = cos(α − 270 • ), the discussion below will only consider the case of sin(α + 90 • ).At the same time, only the impact of errors in the horizontal and vertical motor rotation angles will be considered:    dx P = dx S − h cos β sec 2 τ sin αdτ − h cos β tan τ cos αdα dy P = dy S + h cos β sec 2 τ cos αdτ − h cos β tan τ sin αdα dz P = 0 (54) The comprehensive error of the laser layout point is: The following discussion focuses on the impact of motor rotation errors on the coordinates of the layout points: In normal circumstances, the distance from the layout point to the tip of the alignment pole OP can be controlled within approximately 0.1 m to 0.3 m, meaning the vertical motor rotation angle τ is generally within a range of 2 • ∼ 10 • .The inclination angle β is typically within 10 • , with motor rotation angle error m ′ = 0.02 • ∼ 0.05 • , and h set at 1.8 m.Based on the above formulas, within a certain range, by considering the relationship between the inclination angle β of the alignment pole and the vertical motor rotation angle τ, the distribution diagram of the layout point position error M D caused by motor rotation errors is shown below.
(1) With m ′ = 0.02 • , the average error is ±0.64 mm (Figure 18).(2) With m ′ = 0.05 • , the average error is ±1.60 mm (Figure 19).From the error analysis diagram above, under general conditions, the error of laseraided automatic layout relative to the antenna phase center can approximately be ±2 mm, and the error caused by motor rotation is ±1.6 mm.Considering the antenna phase center error when using network CORS for RTK measurements, the comprehensive error of the automatic laser inertial RTK layout is: It can be concluded that under existing technical conditions, compared to the phase center, the accuracy of conventional RTK inertial tilt layout using network CORS generally lies within ±( 10 ∼ 15) mm.Therefore, the laser-aided automatic layout method proposed in this paper exceeds the precision of conventional RTK layout and offers higher work efficiency.

Experimental Analysis
As shown in Figure 20, this experiment uses the laser GNSS RTK prototype developed based on the aforementioned content.Figure 21 shows that four control points P1 to P4 were set up around the test field, and their coordinates were accurately determined using the Leica TS30 total station (Leica, Wetzlar, Germany), which are used for coordinate parameter conversion in RTK.See Table 7.A set of coordinates for set-out points was designed, initially marked using both conventional RTK and laser automatic RTK.After the set-out is completed, the Leica TS30 total station is used to precisely measure the coordinates of these points and compare them with the designed coordinates to calculate the error m.This provides an objective evaluation of the actual set-out accuracy.The data are shown in Table 8.After confirming the markers with the laser automatic RTK using the CORS network, the coordinates obtained by precise measurement with the total station are, see Table 10.Compare with two different RTK layout data, see Table 11.Due to the measurement errors associated with using the total station, the results calculated from experimental data are slightly larger than the theoretical error values.It can be seen that the laser inertial RTK automatic setting out designed in this paper has higher accuracy compared to conventional inertial RTK layout.

Conclusions
This paper is based on the fusion algorithm of GNSS RTK and inertial navigation technology, and by utilizing a laser to indicate the location of the points to be laid out, proposes a new theory and implementation method for RTK laser automatic layout.The core idea involves using a new fusion parameter calculation method within traditional RTK layout measurements.It obtains the RTK phase center coordinates of the instrument and the three-dimensional spatial position of the tip of the alignment pole under tilt conditions via inertial navigation offsets.By using mathematical transformations, the specific position of the laser rotation center is determined, and subsequently, the rotational angles between the vertical and horizontal directions of the point to be laid out and the calibration direction are calculated.Finally, two servo motors in the vertical and horizontal directions automatically complete the real-time layout measurement of the designated point, verifying the feasibility of this method.The measurement results meet design requirements, enhancing the positioning accuracy and work efficiency of layout measurements.
The GNSS RTK inertial navigation laser layout method proposed in this paper, compared to current traditional layout, inertial-guided RTK layout, and AR-RTK layout, offers better timeliness and cost-effectiveness, with strong comprehensive surveying capabilities, and is easy to automate.However, there are still some shortcomings in this method, such as accuracy being affected in irregular terrain situations, necessitating further research into corresponding solutions and correction algorithms.

Figure 4 .
Figure 4. (a) Front view of the motor and laser installation method; (b) Left view of the motor and laser installation method; (c) Top view of the motor and laser installation method.

Figure 6 .
Figure 6.Top view of the center of laser rotation with RTK phase center in plumb case.

Figure 7 .
Figure 7. Schematic diagram of the pole tip inclination angle.

Figure 8 .
Figure 8. Schematic diagram of motor rotation points.

Figure 9 .
Figure 9.The error distribution chart when the roll angle and pitch angle error are 0.05 degrees and the heading angle error is 0.2 degrees.

Figure 10 .
Figure 10.The error distribution chart when the roll angle and pitch angle error are 0.05 degrees and the heading angle error is 1.0 degrees.

Figure 11 .
Figure 11.The error distribution chart when the roll angle and pitch angle error are 0.1 degrees and the heading angle error is 0.2 degrees.

Figure 12 .
Figure 12.The error distribution chart when the roll angle and pitch angle error are 0.1 degrees and the heading angle error is 1.0 degrees.

Figure 13 .
Figure 13.The error distribution chart when the roll angle and pitch angle error are 0.05 degrees and the heading angle error is 0.2 degrees.

Figure 14 .
Figure 14.The error distribution chart when the roll angle and pitch angle error are 0.05 degrees and the heading angle error is 1.0 degrees.

Figure 15 .
Figure 15.The error distribution chart when the roll angle and pitch angle error are 0.1 degrees and the heading angle error is 0.2 degrees.

Figure 16 .
Figure 16.The error distribution chart when the roll angle and pitch angle error are 0.1 degrees and the heading angle error is 1.0 degrees.

Figure 17 .
Figure 17.Schematic diagram of motor rotation error.

Table 1 .
Coordinates of RTK phase center points A and P to be staked out.

Table 2 .
Coordinates of the cusp O and O ′ of the centering rod.

Table 3 .
Coordinates of point P ′ .

Table 4 .
Lengths of O ′ P ′ and angles φ and α O ′ P ′ .

Table 5 .
Coordinates of tangent points U and V.

Table 8 .
Design the loft point coordinates.

Table 10 .
Network CORS laser inertial navigation RTK automatic layout coordinates.

Table 11 .
Comparison of two different RTK layouts of network CORS.