Skip to content

Commit

Permalink
Don't add IMU data to 2D optimization problem. (#1754)
Browse files Browse the repository at this point in the history
It was constantly added regardless of motion filtering. Since it's not
used it can be just ignored. The method still needs to be there to
satisfy the interface.

Signed-off-by: Michael Grupp <grupp@magazino.eu>
  • Loading branch information
MichaelGrupp committed Oct 6, 2020
1 parent 9675d63 commit af00de3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ OptimizationProblem2D::~OptimizationProblem2D() {}

void OptimizationProblem2D::AddImuData(const int trajectory_id,
const sensor::ImuData& imu_data) {
imu_data_.Append(trajectory_id, imu_data);
// IMU data is not used in 2D optimization, so we ignore this part of the
// interface.
}

void OptimizationProblem2D::AddOdometryData(
Expand Down Expand Up @@ -207,7 +208,7 @@ void OptimizationProblem2D::InsertTrajectoryNode(const NodeId& node_id,
}

void OptimizationProblem2D::TrimTrajectoryNode(const NodeId& node_id) {
imu_data_.Trim(node_data_, node_id);
empty_imu_data_.Trim(node_data_, node_id);
odometry_data_.Trim(node_data_, node_id);
fixed_frame_pose_data_.Trim(node_data_, node_id);
node_data_.Trim(node_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class OptimizationProblem2D
return landmark_data_;
}
const sensor::MapByTime<sensor::ImuData>& imu_data() const override {
return imu_data_;
return empty_imu_data_;
}
const sensor::MapByTime<sensor::OdometryData>& odometry_data()
const override {
Expand Down Expand Up @@ -128,7 +128,7 @@ class OptimizationProblem2D
MapById<NodeId, NodeSpec2D> node_data_;
MapById<SubmapId, SubmapSpec2D> submap_data_;
std::map<std::string, transform::Rigid3d> landmark_data_;
sensor::MapByTime<sensor::ImuData> imu_data_;
sensor::MapByTime<sensor::ImuData> empty_imu_data_;
sensor::MapByTime<sensor::OdometryData> odometry_data_;
sensor::MapByTime<sensor::FixedFramePoseData> fixed_frame_pose_data_;
std::map<int, PoseGraphInterface::TrajectoryData> trajectory_data_;
Expand Down

0 comments on commit af00de3

Please sign in to comment.