I would like to disable the global loop closing in the "pure localization" mode and only rely on the scan matcher.
This however, fails at "snipping" on the map.

This is my config file:
https://gist.github.com/mojovski/536493d912e2c698e20f5df66367a09f
Can somebody have a short look at the config file please?
From my current understanding, the most important parameters should be
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.linear_search_window = 5.45
POSE_GRAPH.constraint_builder.fast_correlative_scan_matcher.angular_search_window = math.rad(10.0)
But this does not work even if the offset between measured wall and the map-wall is smaller than 5.45m
From the logs, I frequently get messages like this one:
| '[ INFO] [1543968245.127004338, 1543932052.588571796 /cartographer_node] [/catkin_ws/src/cartographer_ros/cartographer_ros/cartographer_ros/ros_log_sink.cc:ScopedRosLogSink::send:51]: I1205 00:04:05.000000 93 constraint_builder_2d.cc:284] Score histogram:
slam | Count: 1597 Min: 0.420652 Max: 0.637169 Mean: 0.557787
slam | [0.420652, 0.442303) Count: 5 (0.313087%) Total: 5 (0.313087%)
slam | [0.442303, 0.463955) Count: 11 (0.688792%) Total: 16 (1.001878%)
slam | [0.463955, 0.485607) # Count: 40 (2.504696%) Total: 56 (3.506575%)
slam | [0.485607, 0.507259) # Count: 73 (4.571071%) Total: 129 (8.077645%)
slam | [0.507259, 0.528911) ## Count: 176 (11.020664%) Total: 305 (19.098309%)
slam | [0.528911, 0.550562) #### Count: 309 (19.348780%) Total: 614 (38.447090%)
slam | [0.550562, 0.572214) ##### Count: 404 (25.297432%) Total: 1018 (63.744522%)
slam | [0.572214, 0.593866) #### Count: 355 (22.229179%) Total: 1373 (85.973701%)
slam | [0.593866, 0.615518) ## Count: 184 (11.521603%) Total: 1557 (97.495300%)
slam | [0.615518, 0.637169] # Count: 40 (2.504696%) Total: 1597 (100.000000%)'
To me, it looks like the matching works somewhere... But I have no idea if the right submap has been identified here. Or is this a log output from the global loop closing matcher??
And what is the difference between the fast_correlative_scan_matcher and ceres_scan_matcher?
Answering the last question: See here about correlative matcher as preprocessing for ceres scan matcher: https://github.com/googlecartographer/cartographer_ros/blob/80e4b0826b98dc77172f8fb0b8c0d26c3fcc2348/docs/source/tuning.rst#the-choice-of-scan-matchers
What do you mean by "snipping on the map"?
I took a look at the lua file.
POSE_GRAPH.constraint_builder.min_score = 0.65
Slightly too high because this is above the histogram you show above.
Try 0.5--0.55 for your score histogram.
POSE_GRAPH.constraint_builder.global_localization_min_score = 0.1
Far too low, would spend excessive computation time and find wrong matches.
You say you want to turn off global loop closing, so set this to 0.999
POSE_GRAPH.overlapping_submaps_trimmer_2d
Don't use this for localization, use the localization trimmer instead.
TRAJECTORY_BUILDER_2D.submaps.num_range_data = 2
Almost certainly too low. Need to be the number of incoming laser scan messages per 5--30 seconds.
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
Is not a good choice in most cases. Correlative scan matching with its larger search area is only useful and necessary when a robot rotates far or moves extremely far between two laser scan rotations.
In general, your lua file has too many changes, it is usually better to tune one or two parameters at a time to stay close to the optimum.
Hope this helps.
Set the sampling ratio in constraint builder to zero if you want to disable loop closure.
Hi @gaschler ,
thank you very much for your hints!
Which modules is responsible for matching as a result for the constraints builder? Namely for generating these histograms? How can I tune this?
You said, that using POSE_GRAPH.overlapping_submaps_trimmer_2d for localization is not a good idea. But what is the localization trimmer?
BTW, reducing the min_score did not help
Is there a possibility, that if the computer is too slow, that the loop closing is stalling since all loop closing tasks overfill the stack of the global slam thread?
loop closing tasks overfill the stack of the global slam thread
Yes, loop closing can be delayed by long times because it is queued as background work.
You can register a GlobalSlamCallback and see how for the queue got processed.
Most helpful comment
Set the sampling ratio in constraint builder to zero if you want to disable loop closure.