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

Converting quaternien vector into rpy #122

Open
jviereck opened this issue Jan 16, 2020 · 7 comments
Open

Converting quaternien vector into rpy #122

jviereck opened this issue Jan 16, 2020 · 7 comments

Comments

@jviereck
Copy link
Contributor

Hi,

given a dg::vector representing a quaternion as x, y, z, w, is there a way to convert it to a rpy vector?

There is a QuaternionToMatrix and MatrixToRPY entity here 1. However, I cannot figure out how to get a dg::vector into a VectorQuaternion type.

Best
Julian

@jmirabel
Copy link
Contributor

You look for an entity or a Python function ?

@jmirabel
Copy link
Contributor

I now understand your question. I don't see any QuaternionToRPY in src/matrix/operator.cpp so I guess there is none. I wouldn't be hard to write though.

@gabrielebndn
Copy link
Contributor

I think I have an entity doing more or less that in sot-talos-balance

@jviereck
Copy link
Contributor Author

Thanks for providing the implementation in #121.

What I am missing is also how to get a dg:vector as a VectorQuaternion. When I try to plug a dg::vector as input to a VectorQuaternion, I am getting a type error.

@jmirabel
Copy link
Contributor

Can you provide an example code ?

@jviereck
Copy link
Contributor Author

Here is a reduced example with the corresponding error message:

import dynamic_graph as dg
import dynamic_graph.sot.core

vec = dynamic_graph.sot.core.vector_constant.VectorConstant('vc')
vec.sout.value = (0, 0, 0, 1)

op = dynamic_graph.sot.core.operator.QuaternionToMatrix('q2m')
dg.plug(vec.sout, op.sin)

# dgpyError: Compl. Uncompatible types for plugin.(while trying to plug 
# <sotVectorConstant(vc)::output(vector)::sout> on 
# <QuaternionToMatrix(q2m)::input(VectorQuaternion)::sin>) with types 
# <N5Eigen10QuaternionIdLi0EEE> on <PN12dynamicgraph10SignalBaseIiEE>.

@jmirabel
Copy link
Contributor

I see your problem. I don't think it is implemented.

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

3 participants