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

std container for kindr::QuaternionsD #96

Open
depardo opened this issue Dec 1, 2017 · 1 comment
Open

std container for kindr::QuaternionsD #96

depardo opened this issue Dec 1, 2017 · 1 comment

Comments

@depardo
Copy link

depardo commented Dec 1, 2017

Hi guys,

I'm porting my projects from Eigen to Kindr. I use std containers in some places, for example a map between strings and quaternions:

typedef std::map<std::string,Eigen::Quaternion<double>,std::less<std::string>, Eigen::aligned_allocator<std::pair<const std::string,Eigen::Quaternion<double>>>> QuaternionMap_t

I'm trying to do something similar with Kindr rotations :

typedef std::map<std::string,kindr::RotationQuaternion<double>,std::less<std::string>, std::allocator<std::pair<const std::string,kindr::RotationQuaternion<double>>>> QuaternionMap_t;

but when I try to use the map,

QuaternionMap_t Tn; kindr::RotationQuaternionD Tn_i; Tn["link_name"] = Tn_i;

it doesn't compile:

no match for ‘operator=’ (operand types are ‘std::map<std::basic_string, kindr::RotationQuaternion, std::less<std::basic_string >, std::allocator<std::pair<const std::basic_string, kindr::RotationQuaternion > > >::mapped_type {aka kindr::RotationQuaternion}’ and ‘kindr::RotationQuaternion::Scalar {aka double}’)

/kindr/rotations/RotationQuaternion.hpp:55:7: note: no known conversion for argument 1 from ‘kindr::RotationQuaternion::Scalar {aka double}’ to ‘kindr::RotationQuaternion&&’

I'll appreciate if you can give me some hint about this!

thanks,

Diego

@hogabrie
Copy link
Contributor

hogabrie commented Dec 8, 2017

Hi Diego,

I couldn't reproduce the compilation error with gcc 5.4.0 / Eigen 3.2.92/ latest kindr.

‘kindr::RotationQuaternion::Scalar {aka double}’ to ‘kindr::RotationQuaternion&&’

I can not see where you would need that conversion in your code snippet. It looks like you try to assign a Scalar type to the map somewhere (e.g. Tn_i.z()).

Is it exactly this snippet that you try to compile?

Cheers,
Gabriel

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