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

Backwards assignments #113

Open
mcamurri opened this issue Nov 6, 2018 · 1 comment
Open

Backwards assignments #113

mcamurri opened this issue Nov 6, 2018 · 1 comment

Comments

@mcamurri
Copy link

mcamurri commented Nov 6, 2018

Apologies for the maybe dumb/replicated question (couldn't find a satisfying reply).

How can I assign an Eigen data structure to a kindr one?
I know I can do the opposite by calling the toImplementation() function, but since kindr data structures inherits from Eigen the compiler prevents me from assigning a super class to an inherited one.

Is it legit to do something like the following?:

kindr::Vector3D kindr_v3;
Eigen::Vector3d eigen_v3;
kindr_v3.toImplementation() = eigen_v3;
@remod
Copy link
Member

remod commented Nov 20, 2018

You could use your suggested code, or something like

kindr::Vector3D kindr_v3;
Eigen::Vector3d eigen_v3;
kindr_v3 = kindr::Vector3D(eigen_v3);

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