Hi Folks,
I'm looking to constrain pitch and roll in our 3D pose-graph SLAM system. The SLAM system is fed with 3D odometry from a VINS system (which is gravity aligned using the pre-integration factors)
I don't have access to the pre-integration factor so I wanted to directly constrain these two variables for every pose in the SLAM system.
I've tried adding a prior factor with very large uncertainty on the other variables - that was unstable:
> Pose3 prior_odometry; // the odometry from the VINS systems
> noiseModel::Diagonal::shared_ptr pitch_roll_noise = noiseModel::Diagonal::Sigmas(
> (Vector(6) << 1e-3, 1e-3, 1e10, 1e10, 1e10, 1e10).finished()); // noise
> factor_graph_.emplace_shared<PriorFactor<Pose3> >(headID, prior_input_odometry , pitch_roll_noise) ;
While using a PartialPriorFactor was also unstable or didnt have an effect for different noise levels:
> std::vector<size_t> mask; // A mask with the pitch and roll indices
> mask.resize(2);
> mask[0] = 0;
> mask[1] = 1;
> noiseModel::Diagonal::shared_ptr pitch_roll_noise_2d = noiseModel::Diagonal::Sigmas((Vector(2) << 10., 10.).finished());
> gtsam::Vector2 nerf = Vector2(prior_odometry_roll, prior_odometry_pitch); // the pitch/roll values from the VINS system
> factor_graph_.emplace_shared<PartialPriorFactor<Pose3> >(headID, mask, nerf , pitch_roll_noise_2d); // the factor
Can anyone suggest what type of factor I should use or why these two examples don't work?
The factor graph I'm trying to implement is attached - the orange nodes in particular.
best wishes,
- Maurice