Skip to content

Commit

Permalink
Renames expect_imu to use_imu. (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
damonkohler committed Sep 8, 2016
1 parent fc166fd commit 83a29df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions cartographer/mapping_2d/local_trajectory_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ proto::LocalTrajectoryBuilderOptions CreateLocalTrajectoryBuilderOptions(
parameter_dictionary->GetDictionary("pose_tracker").get());
*options.mutable_submaps_options() = CreateSubmapsOptions(
parameter_dictionary->GetDictionary("submaps").get());
options.set_expect_imu_data(parameter_dictionary->GetBool("expect_imu_data"));
options.set_use_imu_data(parameter_dictionary->GetBool("use_imu_data"));
return options;
}

Expand Down Expand Up @@ -148,7 +148,7 @@ std::unique_ptr<LocalTrajectoryBuilder::InsertionResult>
LocalTrajectoryBuilder::AddHorizontalLaserFan(
const common::Time time, const sensor::LaserFan3D& laser_fan) {
// Initialize pose tracker now if we do not ever use an IMU.
if (!options_.expect_imu_data()) {
if (!options_.use_imu_data()) {
InitializePoseTracker(time);
}

Expand Down Expand Up @@ -236,9 +236,7 @@ LocalTrajectoryBuilder::pose_estimate() const {
void LocalTrajectoryBuilder::AddImuData(
const common::Time time, const Eigen::Vector3d& linear_acceleration,
const Eigen::Vector3d& angular_velocity) {
CHECK(options_.expect_imu_data())
<< "An IMU packet was added, but the IMU is not in the "
"sensor_configuration.";
CHECK(options_.use_imu_data()) << "An unexpected IMU packet was added.";

InitializePoseTracker(time);
pose_tracker_->AddImuLinearAccelerationObservation(time, linear_acceleration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ message LocalTrajectoryBuilderOptions {
optional kalman_filter.proto.PoseTrackerOptions pose_tracker_options = 10;
optional mapping_2d.proto.SubmapsOptions submaps_options = 11;

// True if an IMU is configured in the sensor data.
optional bool expect_imu_data = 12;
// True if IMU data should be expected and used.
optional bool use_imu_data = 12;
}
2 changes: 1 addition & 1 deletion configuration_files/trajectory_builder_2d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
-- limitations under the License.

TRAJECTORY_BUILDER_2D = {
expect_imu_data = true,
use_imu_data = true,
horizontal_laser_min_z = -0.8,
horizontal_laser_max_z = 2.,
horizontal_laser_voxel_filter_size = 0.025,
Expand Down

0 comments on commit 83a29df

Please sign in to comment.