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

Point3 And Point2 In Python #1266

Closed
FaDoSolReLaMiTi opened this issue Aug 8, 2022 · 2 comments
Closed

Point3 And Point2 In Python #1266

FaDoSolReLaMiTi opened this issue Aug 8, 2022 · 2 comments

Comments

@FaDoSolReLaMiTi
Copy link

Description

I managed to compile the Python wrapper but it cannot pass the python-test.
It shows some errors like

RuntimeError: Attempting to retrieve value with key "10", type stored in Values is class gtsam::GenericValue<class Eigen::Matrix<double,-1,1,0,-1,1> > but requested type was class Eigen::Matrix<double,3,1,0,3,1>

In python, Point3 is 1x3 numpy array and converted into Eigen::Matrix<double,-1,1,0,-1,1> when adding the initial values for the solver. However, the factor graph keeps Eigen::Matrix<double,3,1,0,3,1> when adding a factor (e.g. PriorFactorPoint3).

Steps to reproduce

  1. Exactly as instructed to install the python wrapper (static link library).

Expected behavior

It can pass python-test.

Environment

Window 10
VS2019
Python 3.9

@ProfFan
Copy link
Collaborator

ProfFan commented Aug 17, 2022

Interesting, I think I fixed this already in #1168. Can you try using .insertPoint3 and report the results?

@FaDoSolReLaMiTi
Copy link
Author

Thank you very much. It works now. I replaced the initial_values.insert with initial_values.insert_point3 in the python test scripts and then it can pass the python test.

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