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

fix typo in g2o file format parsing for the information matrix #1310

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gtsam/slam/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,12 @@ template <> struct ParseMeasurement<Pose3> {
if (sampler)
T12 = T12.retract(sampler->sample());

// EDGE_SE3:QUAT stores covariance in t,R order, unlike GTSAM:
// EDGE_SE3:QUAT stores information/precision in t,R order, unlike GTSAM:
Matrix6 mgtsam;
mgtsam.block<3, 3>(0, 0) = m.block<3, 3>(3, 3); // cov rotation
mgtsam.block<3, 3>(3, 3) = m.block<3, 3>(0, 0); // cov translation
mgtsam.block<3, 3>(0, 3) = m.block<3, 3>(0, 3); // off diagonal
mgtsam.block<3, 3>(3, 0) = m.block<3, 3>(3, 0); // off diagonal
mgtsam.block<3, 3>(0, 0) = m.block<3, 3>(3, 3); // info rotation
mgtsam.block<3, 3>(3, 3) = m.block<3, 3>(0, 0); // info translation
mgtsam.block<3, 3>(3, 0) = m.block<3, 3>(0, 3); // off diagonal swap
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there should be a comment here specifying that we need to swap to read the matrix in R,t order?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree we should be more explicit on our comments to avoid future confusions

mgtsam.block<3, 3>(0, 3) = m.block<3, 3>(3, 0); // off diagonal swap
SharedNoiseModel model = noiseModel::Gaussian::Information(mgtsam);

return BinaryMeasurement<Pose3>(
Expand Down