ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
4

How do you convert a quaternion into an axis-angle representation?

asked 2012-09-20 13:13:05 -0600

derekjchow gravatar image

updated 2012-09-20 17:06:52 -0600

joq gravatar image

Hello,

I'd like to convert an orientation from geometry_msgs::Quaternion to an axis-angle representation (http://en.wikipedia.org/wiki/Axis-angle_representation). Similarly, I'd like to convert back to a quaternion from an axis-angle value. What ROS libraries are available to preform these conversions?

Thanks

edit retag flag offensive close merge delete

Comments

I answered this question, then edited that and it disappeared. It does not allow me to answer again! The best I could do: https://gist.github.com/e5170cf046b8001f4e65

Mani gravatar image Mani  ( 2012-09-20 15:00:51 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
6

answered 2012-09-20 17:43:49 -0600

jbohren gravatar image

updated 2012-09-20 17:46:18 -0600

TF datatypes are actually re-cast Bullet Datatypes. If you have a tf::Quaternion, you can use any of the functions dejan linked to above, but specifically, you want these two:

double btQuaternion::GetAngle()

btVector3 btQuaternion::GetAxis()

When you want to change the value of a tf::Quaternion from an axis/angle representation, you can use this member function:

void btQuaternion::SetRotation(const btVector3 &axis, const double &angle)

edit flag offensive delete link more
0

answered 2012-09-20 14:39:01 -0600

dejanpan gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-09-20 13:13:05 -0600

Seen: 4,734 times

Last updated: Sep 20 '12