The loop closure algorithm takes in input a support trajectory as explained in 4. Close the loops, which is used for “guessing” where to find loops and optimize them.
On some long sequences, the drift of the odometry trajectory can become huge and vary accross the time, which makes it difficult to take it into account while searching for loops.
Example of long trajectory leading to large drift (224m) on some areas in the odometry trajectory.
In the case where a GNSS trajectory is available, a pre-georeferencing step can be done to correct coarsly the global drift, using the absoluteness of the GNSS measures, and use this pre-optimized trajectory as a support for the loop closure afterwards.
Same trajectory as above with pre-georeferencing
<aside> 💡 Reading the tutorial 5. Georeference a SLAM session would help understanding the following.
</aside>
In the /slam_session_tutorial/1_loop_closure
folder, run the following command
exwayz_georef -t ../traj_odometry.ply -g ../traj_gps.ply -s 20.0 \\
-o traj_pre_fusion_gps.ply
Then, instead of using the traj_odometry.ply as the support trajectory for the loop closure with the Odometry profile, you can use the traj_pre_fusion_gps.ply with the GPS profile:
exwayz_loop_closure -i ../frames -t ./traj_pre_fusion_gps.ply -p GPS -d 5.0