Ask Your Question
1

tf.getYaw() in python? [closed]

asked 2012-08-19 18:59:10 -0600

Well I feel very foolish to ask this question, but I am looking for the equivalent of tf::getYaw() that exists in the C++ API for Python. I've tried looking in the API docs and using the dir() and help() functions in the Python console, but so far coming up short. Does this function exist?

If not, can anyone point to a reliable implementation where I can pass a Quaternion message and get the yaw back? I can go back and rewrite my code in C++, but that would be a little silly.

I'm on Electric

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by dougbot01
close date 2012-09-23 19:15:32

1 Answer

Sort by ยป oldest newest most voted
5

answered 2012-08-19 21:24:15 -0600

michikarg gravatar image

You can use euler_from_quaternion:

 (roll,pitch,yaw) = euler_from_quaternion(quaternion)
edit flag offensive delete link more

Comments

It's basically not a real equivalent but i guess the easiest way to get yaw from a quaternion.

michikarg gravatar imagemichikarg ( 2012-08-19 21:35:01 -0600 )edit
1

Thank you, that works! As a note one must add "from tf.transformations import euler_from_quaternion" to the top of the file. I don't know why I cannot mark this as answered. Someone please help if you can!

dougbot01 gravatar imagedougbot01 ( 2012-08-21 22:09:13 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-08-19 18:59:10 -0600

Seen: 2,467 times

Last updated: Aug 19 '12