cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.09k stars 2.25k forks source link

How to use Overlapping Submaps Trimmer 2D? #1795

Closed CumaOzavci closed 3 years ago

CumaOzavci commented 3 years ago

I am trying to use Overlapping Submaps Trimmer 2D. After adding following lines to .lua file nothing happens.

MAP_BUILDER.pose_graph.overlapping_submaps_trimmer_2d = {
  fresh_submaps_count = 3,
  min_covered_area = 1.0,
  min_added_submaps_count = 5
}

I tried to debug the problem and found that no matter what i set parameters, following line won't be true. https://github.com/cartographer-project/cartographer/blob/fdcf0eb0df72b2eb7ae30c08c873b5ab2b855239/cartographer/mapping/internal/2d/pose_graph_2d.cc#L60


By making hardcoded changes to related files, I can use Overlapping Submaps Trimmer 2D but it is clear that i miss something. Any help would be appreciated.

CumaOzavci commented 3 years ago

I should have used it without "MAP_BUILDER".

POSE_GRAPH.overlapping_submaps_trimmer_2d = {
  fresh_submaps_count = 3,
  min_covered_area = 1.0,
  min_added_submaps_count = 5
}

If you use "MAP_BUILDER", Cartographer won't give an error but won't use Overlapping Submaps Trimmer either.