Add pure localization parameter to trajectory builder options. (#389)
parent
9042450aaf
commit
3f4d795c3e
|
@ -88,6 +88,11 @@ int MapBuilder::AddTrajectoryBuilder(
|
|||
trajectory_options.trajectory_builder_2d_options(),
|
||||
trajectory_id, sparse_pose_graph_2d_.get())));
|
||||
}
|
||||
if (trajectory_options.pure_localization()) {
|
||||
constexpr int kSubmapsToKeep = 3;
|
||||
sparse_pose_graph_->AddTrimmer(common::make_unique<PureLocalizationTrimmer>(
|
||||
trajectory_id, kSubmapsToKeep));
|
||||
}
|
||||
return trajectory_id;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,4 +24,5 @@ message TrajectoryBuilderOptions {
|
|||
trajectory_builder_2d_options = 1;
|
||||
optional mapping_3d.proto.LocalTrajectoryBuilderOptions
|
||||
trajectory_builder_3d_options = 2;
|
||||
optional bool pure_localization = 3;
|
||||
}
|
||||
|
|
|
@ -31,6 +31,8 @@ proto::TrajectoryBuilderOptions CreateTrajectoryBuilderOptions(
|
|||
*options.mutable_trajectory_builder_3d_options() =
|
||||
mapping_3d::CreateLocalTrajectoryBuilderOptions(
|
||||
parameter_dictionary->GetDictionary("trajectory_builder_3d").get());
|
||||
options.set_pure_localization(
|
||||
parameter_dictionary->GetBool("pure_localization"));
|
||||
return options;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,4 +18,5 @@ include "trajectory_builder_3d.lua"
|
|||
TRAJECTORY_BUILDER = {
|
||||
trajectory_builder_2d = TRAJECTORY_BUILDER_2D,
|
||||
trajectory_builder_3d = TRAJECTORY_BUILDER_3D,
|
||||
pure_localization = false,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue