Abstract
Simultaneous Localization and Mapping (SLAM) serves as a foundational technology for autonomous systems operating within large-scale, complex environments. Traditional SLAM methodologies, however, are prone to altitude-axis distortions resulting from cumulative errors. To mitigate these issues, Gravity-Constrained SLAM (GC-SLAM) is introduced as a novel computational method that integrates gravity constraints and incremental optimisation to enhance mapping accuracy and computational efficiency. GC-SLAM incorporates a gravity constraint handling actor within the global optimisation algorithm, effectively reducing vertical-axis errors caused by accumulated drift during mapping. Furthermore, an incremental optimisation strategy is employed to manage the computational complexity associated with increasing map size. Performance evaluations of GC-SLAM are conducted on the KITTI dataset and large-scale environments, comparing its effectiveness against state-of-the-art SLAM-based algorithms, including FAST-LIO2, LIO-SAM (Lidar Inertial Odometry and SLAM), Lego-LOAM (Lightweight and Ground-optimised Lidar Odometry and Mapping), and A-LOAM (Advanced Lidar Odometry and Mapping). Experimental results demonstrate that GC-SLAM effectively suppresses vertical-axis distortions, significantly enhances localisation accuracy, and outperforms competing methods.
Introduction
In the fields of robotics,1–3 autonomous driving,4–6 and augmented reality,7,8 Simultaneous Localization and Mapping (SLAM) technology has garnered significant attention. SLAM enables mobile robots to achieve self-localization and construct environmental maps in unknown environments.9,10 To enhance the robustness and adaptability of SLAM systems, researchers has focused on integrating advanced techniques into its workflow. For example Optimization algorithms11–13 improve SLAM’s real-time map consistency; Combinatorial methods14–16 address multi-robot SLAM coordination; Engineering applications17–19 validate SLAM’s scalability. These integrated approaches enable SLAM to operate effectively in complex scenarios such as autonomous driving20–22 and mobile robotics,23–25 where dynamic environmental interactions demand high reliability.
The accuracy of positioning and mapping is a decisive factor that directly impacts the performance and reliability of robotic systems. Traditional SLAM frameworks often rely on single-sensor configurations tailored for specific scenarios. Such as LiDAR-centric systems for high-precision 3D environmental modeling,26–28 vision and robotic control methods29–31 and structural monitoring techniques.32,33 However, as application scenarios grow more complex, these methods struggle to meet the increasing demands for positioning accuracy and robustness, particularly in large-scale and intricate environments.34,35
In recent years, multi-sensor fusion has emerged as a dominant research direction, with various strategies proposed to enhance performance.36–38 Technologies in this area utilize data integration from multiple sensors to address traditional lasers39–41 as well as SLAM systems that fuse vision, 42 improving their reliability and accuracy across diverse applications, for example, in multi-task execution43,44 and multi-bot,45,46 as well as in task provisioning.47,48
Cartographer 49 employs a sparse pose graph optimisation method, integrating Lidar, IMU, wheel odometer, and GPS as factor nodes. It establishes constraints through pose relationships and incorporates back-end loop closure factors for optimisation, achieving notable success in 2D laser SLAM with widespread engineering applications. Similarly, Lidar Odometry and Mapping (LOAM) 39 adopts multi-sensor fusion for 3D mapping, leveraging surface and edge feature extraction to reduce computational complexity. Its separation of processing structures ensures real-time, high-precision localization and mapping.
Building on LOAM, methods such as Lightweight and Ground Optimized LOAM (LeGO-LOAM), 40 Robust LOAM (R-LOAM), 50 Fast LOAM (F-LOAM), 51 and Lidar-Inertial Odometry with GPS-SLAM (LIO-SAM) 41 have achieved robust results in common scenarios. However, these approaches often face challenges in complex, large-scale environments. Cumulative errors can result in height-direction warping, undermining map accuracy and reliability and, in some cases, preventing successful map construction. Addressing these issues—reducing cumulative errors and suppressing map distortion while maintaining computational efficiency-remains a critical challenge in SLAM research.
This study introduces a novel SLAM computational method designed to address the warping problems observed in mainstream algorithms when applied to complex, large-scale environments. The primary contributions of the proposed approach are outlined as follows:
A new SLAM algorithm, A The effectiveness of the
Related work
Currently, most mainstream SLAM algorithms are based on graph optimisation.40,41,52 These algorithms perform global optimisation through back-end loop closure detection to eliminate cumulative errors. However, in large-scale, complex scene reconstruction, the long distances involved in loop detection prevent these algorithms from addressing cumulative errors promptly, resulting in map warping.
As illustrated in Figure 1, the FAST-LIO2 mapping of the park dataset exhibits a significant warping issue. Regions A and B in Figure 1 correspond to the same physical location but are misaligned due to cumulative errors along the gravity direction. This issue is not exclusive to FAST-LIO2; in extensive and complex environments, warping problems are observed as a common challenge across mainstream SLAM algorithms.53–55

FAST-LIO2 mapping on park dataset.
In recent years, several studies have applied gravity as a constraint in SLAM. For example, VINS-Mono 56 aligns the Structure from Motion (SFM) results with the IMU integral in a loosely coupled manner, corrects the gravity vector, and then rotates it to the z-axis to obtain the rotation relationship between the world coordinate system and the camera coordinate system. Kubelka 57 proposed Kubelka proposed a tightly-coupled variant of the Iterative Closest Point (ICP) algorithm 58 for the front-end of LiDAR SLAM. This algorithm utilizes the observable degrees of freedom in the IMU orientation to obtain pose estimates aligned with the gravity vector, simplifies the 6-degree-of-freedom (DOF) pose estimation to 4 DOF, and reduces mapping drift. Verified by experiments in large-scale outdoor environments and the DARPA Subterranean Challenge, compared with the standard 6-DOF ICP, the new algorithm can reduce the localization drift. However, this method only considers the gravity vector at the front-end of the SLAM process. Recently, PALoc 59 used gravity measurements from the IMU as a constraint factor to optimise the map globally, generating high-quality ground truth trajectories, but only under the zero velocity update condition. In these related works, gravity constraints were applied either to the front-end or the back-end under specific conditions.
In contrast, the aim is to incorporate gravity constraint factors into the back-end without being restricted to specific conditions. For mapping in complex and large-scale scenarios, gravity constraint factors are proposed to be integrated into the factor graph. By leveraging IMU data, point cloud data can be corrected to eliminate accumulated errors along the vertical direction. This approach addresses the issue of delayed optimisation caused by excessively long loop detection distances.
Building on previous work, the proposed approach integrates gravity constraints into back-end optimisation, leveraging an incremental approach to address computational complexity. iSAM 37 first introduced incremental optimisation, using Bayesian networks to efficiently merge new observations with historical data, performing optimisation only on the affected parts. This method reduces computational complexity and enables the application of SLAM technology in large-scale environments. Building on this, iSAM2 38 uses a Bayesian tree structure to improve the algorithm’s efficiency and flexibility. Additionally, algorithms such as LIO-SAM, Cartographer, PL-VIO, 42 and Kintinuous 60 also employ incremental optimisation techniques.
In summary, most current mainstream SLAM algorithms are based on graph optimization. They rely on backend loop closure detection for global optimization to eliminate cumulative errors. Only a few algorithms use IMU data to correct map warping in specific environments or at the front-end of the SLAM system. The above-mentioned solutions provide the foundation and feasibility for the algorithm in this paper. However, in practical engineering applications, there are still situations such as the inability to perform global optimization due to the lack of loop closures and complex and changeable environments. Moreover, due to the limited accuracy of industrial sensors, correcting only at the front-end will still lead to error accumulation. Considering the computational demands introduced by the gravity constraint factor and the increased complexity as the map expands, incremental optimisation is applied to reduce computational overhead and improve the system’s real-time performance. Additionally, the gravity constraint factor can be frequently invoked to eliminate accumulated errors.
The architecture of the proposed method is presented, consisting of five components: Lidar-Inertial Odometry (LIO), Loop Closure Detection, Factor Graph, Incremental Optimisation, and Gravity Direction Extraction, as shown in Figure 2. The LIO component fuses sensor data to obtain laser odometry. The Loop Closure Detection function determines whether the robot has revisited a previously encountered location. The Factor Graph algorithmic component uses this information as constraints to construct a graph model. By incorporating data from the Factor Graph component, GPS data, and the Gravity Direction Extraction function, Incremental Optimisation is triggered to refine the graph model, yielding the optimal trajectory and map.

Architecture of the GC-SLAM algorithm.
Inspired by LIO-SAM 41 and LEGO-LOAM, 40 the LIO component of the method presented in this paper follows a similar approach, encompassing five primary algorithmic components: IMU pre-integration, LiDAR data distortion correction, point cloud feature extraction, pose prediction, and laser odometry acquisition. The data obtained from IMU pre-integration 61 is used to rectify distortions in the LiDAR data. Following this, feature extraction 62 is performed on the corrected LiDAR data to identify both line and plane features. The pose prediction component primarily employs a nonlinear optimisation method 41 to fuse data from the IMU and wheel odometry, deriving an estimated inter-frame pose, which serves as the iterative initial value for the ICP (Iterative Closest Point) matching algorithm 58 to solve for accurate laser odometry.
Loop closure detection
In this study, the Scan Context method proposed by Kim et al. 63 is adopted for loop closure detection, seamlessly integrating laser point cloud data with map information to determine whether the robot has revisited a known location. The Scan Context method converts point clouds into rotationally invariant images using a two-dimensional descriptor, expediting the search for potential loop closure candidates through Ring Keys. Specifically, the Ring Key of the point cloud frame to be matched is searched in the KD Tree to find similar values and their corresponding scan indices. Then, the distances between the Scan Contexts of the selected candidate frames and that of the point cloud to be matched are calculated. In the subsequent matching process, the optimal loop closure candidate is identified. In the design of this algorithm, the distance threshold for judgment and the similarity threshold are set to 2 meters and 0.4 respectively. Among the key frames that meet the conditions, the candidate frame with the highest similarity is selected for verification. The candidate frame with the highest similarity is selected for verification to ensure the accuracy of the match. Once validated, this critical information is incorporated into the SLAM system’s pose graph optimisation, reducing accumulated errors and enhancing map coherence. The Scan Context method, known for its efficiency and accuracy, significantly improves the loop closure detection capabilities of laser SLAM. Upon detection, the loop closure factor is added to the factor graph, enabling global optimisation.
Factor graph
As shown in Figure 3, the factor graph consists of observation factors, motion factors, and prior factors. The observation factors provide absolute pose constraints for the robot state and include gravity factors, loop closure factors, and GPS factors. These factors indicate the constraint relationship between poses generated by the robot motion model, which is primarily composed of laser odometry poses. The prior factors represent prior knowledge of the system state and are used to initialise or fix the system state.

GC-SLAM factor graph.
To address the issue of map distortion, a Gravity Direction extraction component has been designed. This algorithmic component extracts the gravity direction from the IMU, compares it with the gravity direction in the map, and uses the comparison as a gravity constraint factor for optimisation.
The gravity constraint factor is generated as follows. The map pose at the
Incremental optimisation achieves efficient computation and real-time response by optimising only new or changed data, while maintaining the scalability of the system and avoiding redundant computation typically caused by global optimisation. This method not only improves the efficiency of processing large-scale data, but also reduces the complexity of implementation. When no loop closure is detected, incremental optimisation is performed using GPS data, gravity data, and LiDAR odometry pose data. The proposed algorithm can suppress map warping and optimise positioning at a frequency of 10 Hz. The set of state variables is denoted as
Expanding this:
Since the term that does not contain
This can be further organised as:
This process is repeated until
To evaluate the effectiveness of GC-SLAM in suppressing map warping and improving positioning accuracy, comparative experiments were conducted with LIO-SAM, Lego-LOAM, FAST-LIO2, and A-LOAM across three scenarios.
The first experiment was conducted using the Park dataset, a complex large-scale scene with few loops. This experiment aimed to verify the ability of GC-SLAM to suppress the map warping phenomenon, which is common in mainstream algorithms. Practical experience shows that map distortion exceeding 2 m significantly impacts robot navigation. The following formula was used to determine whether the map was warped, based on the value of the height error:
The second experiment was conducted on the Farm dataset. While the scene is not large, it is complex due to the lack of linear features. This experiment aimed to demonstrate the significant improvement of GC-SLAM over other algorithms in small but complex environments, and to verify the effectiveness of gravity in eliminating errors along the Z-axis.
The third experiment was performed using the KITTI dataset to verify that GC-SLAM also offers significant advantages in positioning accuracy in common scenarios.
The experiments were conducted using two sets of equipment: a handheld laser scanner and a six-wheeled experimental cart. The experimental setup is shown in Figure 4. The handheld scanner was equipped with a RoboSense 16-line LiDAR, a 6-axis IMU, and a single-antenna Real-Time Kinematic (RTK) to collect data for the farm scenario. The six-wheeled cart was equipped with a VLP-16-line LiDAR, a 6-axis IMU, and dual-antenna RTK to collect data for the park scenario. Finally, the collected datasets, along with the KITTI dataset, were processed on an Intel Core i7-6600U processor.

Dataset acquisition equipment. (a) Handheld laser scanner; (b) Six-wheeled experimental cart.
The first experimental scenario took place in a park that spans an area larger than 1000 m by 500 m, with a total length exceeding 3000 m. In this dataset, we employed a method where the robot starts from the origin, completes a loop, and returns to the origin to test the algorithm’s ability to suppress map warping. As shown in Figure 5, the six-wheeled experimental vehicle starts from the black box, collects park data along a loop, and returns to the black box.

Schematic diagram of the experimental vehicle’s origin.
This represents a typical dataset encountered in industrial applications. Mapping experiments were performed using each algorithm, and the resulting mapping outcomes are presented in Figure 6.

Mapping results of methods using the park dataset. (a) LEGO-LOAM; (b) LIO-SAM; (c) A-LOAM; (d) GC-SLAM.
Figure 6 shows the trajectory of each algorithm on the park dataset, with the red boxes indicating the starting and ending positions, which should coincide. Lego-LOAM, LIO-SAM, A-LOAM, and FAST-LIO exhibit significant warping issues in the altitude direction. In contrast, there is no warping in the red box for GC-SLAM, demonstrating its significant effectiveness in inhibiting map distortion. The robot starts from the black box in Figure 5, travels around the drivable roads in the park, and then returns to the black box. Since the robot completes a loop and returns to the starting point, the actual height change between the start and end points should ideally be 0. Table 1 shows the height differences (height errors) between the starting and ending points for each algorithm, which vividly reflects the degree of distortion in other algorithms. The smaller the height error, the better the algorithm’s ability to suppress map warping.
The warping results of the park dataset.
The second experiment uses a farm dataset, where the acquisition path spans approximately 720 metres away from the passable road within the farm. The true trajectory of the path is provided by RTK positioning data. This dataset represents a small yet complex environment, characterised by a large number of plants and a lack of linear and planar features in the sensor data, which impacts the mapping performance. Each algorithm is built and compared using this dataset. The results of the acquisition environment and experimental trajectory are shown in Figure 7, while the error comparison results are provided in Table 2 and Figure 8. In Table 2, “Max”, “Min”, and “Rmse” represent the maximum error, minimum error, and root mean square error, respectively, between the algorithm’s trajectory and the true trajectory.

Trajectory result of GC-SLAM using the Farm dataset. (a) Data acquisition environment; (b) Mapping results of farm.

The ATE(m), CPU usage, and memory occupancy rate on the farm dataset.
These values were further analysed, and the Absolute Trajectory Errors (ATE)64,65 were compared. The calculation formula is as follows:
In order to further explore what losses this algorithm brings in suppressing map warping and improving positioning accuracy, we have statistically analyzed the average values of the CPU occupancy rate and the computer memory occupancy rate during the algorithm’s operation. The results are shown in Table 2. As can be seen from the table, the accuracy of the proposed algorithm has significantly improved compared to other algorithms. However, there is a certain increase in CPU and memory (Mem) occupancy rates. Nevertheless, considering the high-efficiency processing capabilities of current computers, these increases are acceptable, and they will not affect the real-time processing ability of our algorithm.
As in Figure 9, we compares the Absolute Trajectory Error (ATE) over time for six algorithms. The results demonstrate that GC-SLAM consistently achieves the lowest ATE values throughout the entire trajectory (0–600 seconds), significantly outperforming other methods.

Absolute trajectory error (ATE) over time for different algorithms.
In the third experiment, sequence 2011-09-30-drive-0027 (KITTI07) from the KITTI 66 dataset is used, which represents a common scenario for illustrating the localisation accuracy of SLAM in typical environments. GC-SLAM is tested and compared with each of the other algorithms. The displacement curves along the x, y, and z axes for each algorithm are shown in Figure 10, and the error comparison results are presented in Table 3.

ATE analysis table of KITTI07 dataset.
As can be seen from Figure 10, the results of each algorithm are relatively close in the
As shown in Table 3, the experimental results are quantitatively analysed, and it is evident that GC-SLAM demonstrates higher accuracy and superior attitude estimation capabilities compared to other algorithms, even in common scenarios.
Through three experiments, the advantages of GC-SLAM have been demonstrated, and the effectiveness of the gravity constraint method combined with incremental optimisation in suppressing map warping and improving positioning accuracy has been validated. The experimental results show that GC-SLAM not only provides exceptional mapping capabilities in complex and large-scale environments—capabilities not found in other algorithms—but also achieves significantly better positioning accuracy than the other algorithms in common scenarios.
As presented in Table 4, we have conducted a statistical significance analysis to evaluate the differences between GC-SLAM and other algorithms. The results demonstrate that GC-SLAM significantly outperforms other methods in terms of localization accuracy and map quality.
Mean value
Additionally, we carried out an ablation study to verify the roles of the key subsystems in GC-SLAM, especially the gravity constraint factor and the incremental optimization strategy. The results shown in Figure 11 and Table 5 indicate that in Figure 11, we explored the outcomes of whether the system adopted the incremental approach or not. It can be seen that as the operation scenarios expand, the processing time of the traditional optimization algorithm becomes progressively longer and fails to meet the real-time requirements of the system. In contrast, GC-SLAM can still maintain a relatively fast processing speed even when the data volume increases. Table 5 shows the effects of warp suppression for three datasets under the conditions of adding and not adding the gravitational constraint factor, as demonstrated by the Z-axis error table. It can be observed that after adding this module to the system, the map warping is effectively suppressed. In the park dataset, due to the lack of loop closures over long distances, optimization cannot be carried out, so the map warping is extremely severe, reaching 15.72 meters. However, in the farm and KITTI datasets, because of the existence of loop closures, the map drift is not that serious. Both of these subsystems play a vital role in suppressing map distortion and improving positioning accuracy. Removing either of these subsystems will lead to a significant decline in performance, particularly in complex and large-scale environments.

Processing time(ms) as the amount of lidar scans.
Z-axis error(m) table.
Experimental results demonstrate that, compared to existing SLAM frameworks, GC-SLAM effectively suppresses vertical-axis map distortion and achieves higher localization accuracy. This section further elaborates on the implications of these results, the limitations of the proposed method, and potential avenues for future research. The primary advantages and contributions of GC-SLAM include:
Additionally, GC-SLAM has some limitations, such as increased computational overhead. While GC-SLAM’s incremental optimization mitigates computational demands, the addition of gravity constraints and frequent optimizations elevate CPU/memory usage (Tables 2 and 3). This may pose challenges for deployment on resource-constrained platforms (e.g., low-power robots or edge devices).
Conclusion
This paper presents GC-SLAM, a novel SLAM algorithm designed to address the warping issue in the gravity direction commonly encountered in complex and large-scale environments. By integrating incremental optimisation with a gravity constraint, GC-SLAM effectively mitigates the cumulative errors in altitude direction while maintaining computational efficiency. Operating at a frequency of 10 Hz, the proposed method not only suppresses map warping but also optimises positioning accuracy, reducing errors in the altitude direction across large and complex scenes. These advancements improve both the precision of positioning and the system’s real-time performance by efficiently managing computational resources.
Experimental results demonstrate the superiority of GC-SLAM over existing state-of-the-art methods. The proposed method outperforms current open-source solutions in both self-collected datasets from large-scale environments and well-established open-source datasets, confirming its robustness and practical applicability. The findings highlight GC-SLAM’s potential to enhance SLAM performance, particularly in scenarios where map warping and positioning accuracy are critical.
Footnotes
Acknowledgments
This work was supported by the Sichuan Science and Technology Program (2023YFG0046 and 2023NSFSC1985). We also acknowledge the Jiangsu Distinguished Professor Programme for their support.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article.
Conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
