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

Enforce g2o formatting #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adthoms
Copy link

@adthoms adthoms commented Jun 17, 2024

Issue Addressed: #3

Description: @yuluntian In DPGO's implementation, there is an inherent assumption that only monotonically increasing sets of consecutive pose IDs, starting at index 0, are valid (i.e., {0,1,2,...,N-1} where N is the number of poses). This is particularly evident in the way the PoseGraph class updates its number of poses, as this class only considers the maximum pose ID in its updates (e.x., ID sets such as {0,1,5,10,20} and {1000,1001,1002,...,N-1001} would be invalid). Given this, I have enforced the formatting of g2o files in read_g2o_file() while also providing log error messages when odometry is discontinuous (there are no checks in read_g2o_file for continuous odometry given DPGO's current design of separating odometry measurements outside of this function). On updating the datasets to suit DPGO's g2o formatting requirements, I have (manually) updated the ais2klinik.g2o dataset as it only contained one missing odometry measurement (likely, this discontinuity reveals two distinct odometry chains, and thus I have set the weight of this edge to be negligible). For datasets cubicle.g2o and rim.g2o, correcting these datasets will require automating this process, which I may get around to at a later time.

Copy link
Collaborator

@yuluntian yuluntian left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Please see my comments

const size_t first_pose_id = *pose_ids.begin();

// Check for consecutive sequencing of pose IDs
size_t prev_pose_id = first_pose_id - 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

@adthoms This will cause overflow because prev_pose_id is unsigned and first_pose_id is nominally zero.

@@ -22403,6 +22403,7 @@ EDGE_SE2 7285 7286 0.628132 0.0065 0.009066 102.196 3.89037 9.59586 105.601 8.07
EDGE_SE2 7286 7287 0.52826 0.000141 -0.002814 100.995 1.65564 3.57699 105.323 1.86886 248.159
EDGE_SE2 7287 7288 0.481197 0.000464 0.019296 101.345 2.64031 0.816055 106.074 2.28584 273.897
EDGE_SE2 7288 7289 0.620686 0.02638 0.08998 103.967 5.06454 -25.856 108.448 -16.176 302.116
EDGE_SE2 7289 7290 69.372726 240.060823 -0.504155 1e-06 1e-06 1e-06 1e-04 1e-04 1e-04
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure about adding this edge because it will change the optimal cost and solution (although probably in a negligible way), and so might confuse others who just want to access the original dataset to test other solvers.

For now, I think leaving the dataset unchanged but printing the errors in dpgo as you have implemented is a better way to go.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, it's possible that the consecutive ID assumption is only needed by odometry initialization and chordal initialization. So one could potentially just improve these initialization implementations without changing the dataset, but I will need to confirm this is the case.

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

Successfully merging this pull request may close these issues.

2 participants