27 void PopulateOverlappingSubmapsTrimmerOptions2D(
28 proto::TrajectoryBuilderOptions*
const trajectory_builder_options,
29 common::LuaParameterDictionary*
const parameter_dictionary) {
30 constexpr
char kDictionaryKey[] =
"overlapping_submaps_trimmer_2d";
31 if (!parameter_dictionary->HasKey(kDictionaryKey))
return;
33 auto options_dictionary = parameter_dictionary->GetDictionary(kDictionaryKey);
35 trajectory_builder_options->mutable_overlapping_submaps_trimmer_2d();
36 options->set_fresh_submaps_count(
37 options_dictionary->GetInt(
"fresh_submaps_count"));
38 options->set_min_covered_area(
39 options_dictionary->GetDouble(
"min_covered_area"));
40 options->set_min_added_submaps_count(
41 options_dictionary->GetInt(
"min_added_submaps_count"));
48 proto::TrajectoryBuilderOptions options;
49 *options.mutable_trajectory_builder_2d_options() =
51 parameter_dictionary->
GetDictionary(
"trajectory_builder_2d").get());
52 *options.mutable_trajectory_builder_3d_options() =
54 parameter_dictionary->
GetDictionary(
"trajectory_builder_3d").get());
55 options.set_pure_localization(
56 parameter_dictionary->
GetBool(
"pure_localization"));
57 PopulateOverlappingSubmapsTrimmerOptions2D(&options, parameter_dictionary);
63 switch (sensor_id.
type) {
65 sensor_id_proto.set_type(proto::SensorId::RANGE);
68 sensor_id_proto.set_type(proto::SensorId::IMU);
71 sensor_id_proto.set_type(proto::SensorId::ODOMETRY);
74 sensor_id_proto.set_type(proto::SensorId::FIXED_FRAME_POSE);
77 sensor_id_proto.set_type(proto::SensorId::LANDMARK);
80 sensor_id_proto.set_type(proto::SensorId::LOCAL_SLAM_RESULT);
83 LOG(FATAL) <<
"Unsupported sensor type.";
85 sensor_id_proto.set_id(sensor_id.
id);
86 return sensor_id_proto;
92 switch (sensor_id_proto.type()) {
93 case proto::SensorId::RANGE:
96 case proto::SensorId::IMU:
99 case proto::SensorId::ODOMETRY:
103 case proto::SensorId::FIXED_FRAME_POSE:
107 case proto::SensorId::LANDMARK:
111 case proto::SensorId::LOCAL_SLAM_RESULT:
116 LOG(FATAL) <<
"Unsupported sensor type.";
118 sensor_id.
id = sensor_id_proto.id();
PoseGraph::Constraint::Tag FromProto(const proto::PoseGraph::Constraint::Tag &proto)
proto::LocalTrajectoryBuilderOptions2D CreateLocalTrajectoryBuilderOptions2D(common::LuaParameterDictionary *const parameter_dictionary)
proto::TrajectoryBuilderOptions CreateTrajectoryBuilderOptions(common::LuaParameterDictionary *const parameter_dictionary)
std::unique_ptr< LuaParameterDictionary > GetDictionary(const std::string &key)
proto::MapLimits ToProto(const MapLimits &map_limits)
bool GetBool(const std::string &key)
::cartographer::mapping::TrajectoryBuilderInterface::SensorId SensorId
proto::LocalTrajectoryBuilderOptions3D CreateLocalTrajectoryBuilderOptions3D(common::LuaParameterDictionary *parameter_dictionary)