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

How to add vertex to pose graph? (what is pose?) #32

Open
lvgeng opened this issue Jul 10, 2019 · 1 comment
Open

How to add vertex to pose graph? (what is pose?) #32

lvgeng opened this issue Jul 10, 2019 · 1 comment

Comments

@lvgeng
Copy link

lvgeng commented Jul 10, 2019

https://github.com/uoip/g2opy#pose-graph-optimization
gives an example of optimizer.
However, how to use the functions defined is confusing. For instance, the function

add_vertex(self, id, pose, fixed=False)

requires "pose", but it is unclear what type it is. For instance, I have a 4x4 transformation matrix (or translation and orientation), how to convert it to a "pose"?

And the same issue for set_vertex() in add_edge(). These functions are just hard to understand, and the C++ documents does not have functions with same names.

@ylmzkaan
Copy link

it is a little bit late but here is the answer to your question.

The input ‘pose’ to the function add_vertex should be a g2o.Isometry3d object which you can instantiate in one of the following ways:

g2o.Isometry3d( a 4x4 np.ndarray transformation matrix )

g2o.Isometry3d( a 3x3 np.ndarray rotation matrix, a 3x1 np.ndarray translation matrix )

I think there are 2 more constructors for Isometry3d but these should be enough.

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