Use area instead of cells count for overlapping trimmer options. (#1080)

master
Alexander Belyaev 2018-04-17 18:22:38 +02:00 committed by Wally B. Feed
parent 26e8ce63ba
commit 23f6de46b0
3 changed files with 7 additions and 4 deletions

View File

@ -127,7 +127,10 @@ int MapBuilder::AddTrajectoryBuilder(
trajectory_options.overlapping_submaps_trimmer_2d(); trajectory_options.overlapping_submaps_trimmer_2d();
pose_graph_->AddTrimmer(common::make_unique<OverlappingSubmapsTrimmer2D>( pose_graph_->AddTrimmer(common::make_unique<OverlappingSubmapsTrimmer2D>(
trimmer_options.fresh_submaps_count(), trimmer_options.fresh_submaps_count(),
trimmer_options.min_covered_cells_count())); trimmer_options.min_covered_area() /
common::Pow2(trajectory_options.trajectory_builder_2d_options()
.submaps_options()
.resolution())));
} }
} }
if (trajectory_options.pure_localization()) { if (trajectory_options.pure_localization()) {

View File

@ -34,7 +34,7 @@ message TrajectoryBuilderOptions {
message OverlappingSubmapsTrimmerOptions2D { message OverlappingSubmapsTrimmerOptions2D {
int32 fresh_submaps_count = 1; int32 fresh_submaps_count = 1;
int32 min_covered_cells_count = 2; double min_covered_area = 2;
} }
OverlappingSubmapsTrimmerOptions2D overlapping_submaps_trimmer_2d = 5; OverlappingSubmapsTrimmerOptions2D overlapping_submaps_trimmer_2d = 5;
} }

View File

@ -35,8 +35,8 @@ void PopulateOverlappingSubmapsTrimmerOptions2D(
trajectory_builder_options->mutable_overlapping_submaps_trimmer_2d(); trajectory_builder_options->mutable_overlapping_submaps_trimmer_2d();
options->set_fresh_submaps_count( options->set_fresh_submaps_count(
options_dictionary->GetInt("fresh_submaps_count")); options_dictionary->GetInt("fresh_submaps_count"));
options->set_min_covered_cells_count( options->set_min_covered_area(
options_dictionary->GetInt("min_covered_cells_count")); options_dictionary->GetDouble("min_covered_area"));
} }
} // namespace } // namespace