Skip to content

Commit

Permalink
fix uninitialized acceleration and overwritten jacobian
Browse files Browse the repository at this point in the history
  • Loading branch information
henrygerardmoore committed Dec 13, 2024
1 parent fe83249 commit ebc6566
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,9 @@ inline void predict(const fuse_core::Vector3d& position1, const Eigen::Quaternio
vel_linear2.y(), vel_linear2.z(), vel_angular2.x(), vel_angular2.y(), vel_angular2.z(), acc_linear2.x(),
acc_linear2.y(), acc_linear2.z(), jacobians.data(), jacobian_quat2rpy);

jacobian << J[0], J[1], J[2], J[3], J[4];
// TODO(henrygerardmoore): figure out how to fix this
// see https://github.com/locusrobotics/fuse/pull/354#discussion_r1884288806
jacobian << J[0], J[1], J[2], J[3], J[4].block<15, 2>(0, 0);

// Convert back to quaternion
orientation2 = Eigen::AngleAxisd(rpy[2], Eigen::Vector3d::UnitZ()) *
Expand Down
4 changes: 4 additions & 0 deletions fuse_models/src/odometry_3d_publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ void Odometry3DPublisher::predict(tf2::Transform& pose, nav_msgs::msg::Odometry&
acceleration_linear << acceleration_output.accel.accel.linear.x, acceleration_output.accel.accel.linear.y,
acceleration_output.accel.accel.linear.z;
}
else
{
acceleration_linear = fuse_core::Vector3d::Zero();
}

::fuse_models::predict(position, orientation, velocity_linear, velocity_angular, acceleration_linear, dt, position,
orientation, velocity_linear, velocity_angular, acceleration_linear, jacobian);
Expand Down

0 comments on commit ebc6566

Please sign in to comment.