cartographer-project / cartographer_ros

Provides ROS integration for Cartographer.
Apache License 2.0
1.64k stars 1.2k forks source link

no 'GPS-RTK fix' used in pure localization mode (feature request) #1655

Open greymfm opened 3 years ago

greymfm commented 3 years ago

Our robot gets scattered GPS/RTK fix (with scattered I mean it gets an cm-precise NavSatFix::fix (RTK) at certain places, NavSatFix::no-fix otherwise). It seems Cartographer does not use GPS (NavSatFix messages) in pure localization mode. However, this feature would help our robot (with a 90 degree FOV Livox Horizon 3D LiDAR) greatly to correctly localize in saved Cartographer maps (like it already does nice to correct pose graphs in mapping mode).

Maybe this 'feature' is already implemented and I don't see it? :-) It seems the 'fixed_frame_pose_translation_weight' is ignored in pure localization mode? (and is only used in mapping mode)

I use these changed settings for mapping/localization with scattered GPS fix: options = { use_nav_sat = true, num_laser_scans = 0, num_point_clouds = 1, }

POSE_GRAPH.optimization_problem.fixed_frame_pose_rotation_weight = 0 -- GPS provides no orientation. POSE_GRAPH.optimization_problem.fixed_frame_pose_translation_weight = 1000

--pure-localization TRAJECTORY_BUILDER.pure_localization_trimmer = { max_submaps_to_keep = 9, -- tried vaues from 3 to 9 here }

Example map we use for pure localization mode (map was nicely optimized using RTK-GPS in mapping mode): Screenshot from 2021-07-07 22-13-32

In pure localization mode with RTK-GPS fix it does not localize in existing map (generates duplicate submaps): Screenshot from 2021-07-09 12-30-17

greymfm commented 3 years ago

Addendum: So, when comparing LiDAR-only and assisted GPS sessions (here 2D pure localization), cartographer actually seem to consider the RTK-GPS data ( https://www.youtube.com/watch?v=Bql208iOUp4 ) - however, you still have to give a rough initial position estimate - cartographer will not use the GPS data as initial position estimate - maybe you have discovered the same and can share your experience...