The way that I do it using tf is like this (ROS Fuerte) . [Assuming that q_msg
is geometry_msgs::Quaternion
]
#include <tf/tf.h>
...
double roll, pitch, yaw;
tf::Quaternion q;
tf::quaternionMsgToTF(q_msg, q);
tf::Matrix3x3(q).getEulerYPR(yaw, pitch, roll);
You can also use fixed-angle function getRPY
. More information can be found here: http://www.ros.org/wiki/geometry/RotationMethods#Bullet
It is possible to use Bullet
directly. Lots of tf
stuff are just wrappers around Bullet
. Unfortunately I had some problems adding Bullet
directly as a rosdep
to my package.