Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does odometry_estimation_cpu.cpp add both a BetweenFactor and PriorFactor to the graph? #155

Open
VRichardJP opened this issue Feb 20, 2025 · 1 comment

Comments

@VRichardJP
Copy link

In odometry_estimation_cpu.cpp:

// TODO: Extract a relative pose covariance from a frame-to-model matching result?
factors.emplace_shared<gtsam::BetweenFactor<gtsam::Pose3>>(X(last), X(current), gtsam::Pose3(T_last_current.matrix()), gtsam::noiseModel::Isotropic::Precision(6, 1e3));
factors.emplace_shared<gtsam::PriorFactor<gtsam::Pose3>>(X(current), gtsam::Pose3(T_target_imu.matrix()), gtsam::noiseModel::Isotropic::Precision(6, 1e3));

There are 2 factors added to the graph:

  • a BetweenFactor factor, which constraints the motion between between 2 scans
  • a PriorFactor factor, which constraints the absolute position of the last scan in the current target point cloud

Since both factor are tightly coupled, I have the feeling there are redundant. Are they?

@VRichardJP VRichardJP changed the title Why does odometry_estimation_cpu.cpp adds both a BetweenFactor and PriorFactor to the graph? Why does odometry_estimation_cpu.cpp add both a BetweenFactor and PriorFactor to the graph? Feb 20, 2025
@koide3
Copy link
Owner

koide3 commented Feb 21, 2025

Yeah, the current form is a bit redundant. I first tried to use only BetweenFactor to smoothly fuse LiDAR ego-motion estimation and IMU prediction, but it resulted in an unstable strange behavior due to inconsistent local point cloud map and estimated pose history. Then, I added PriorFactor to force the estimate to be consistent with the local map, and it worked somehow. Maybe it's fine to remove BetweenFactor in the current implementation.

BTW, I don't really like this kind of scan-to-model matching because it has problems in IMU fusion like this, and thus I take a different approach based on keyframe matching in the GPU-based odometry estimation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants