ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

See also this question: http://answers.ros.org/question/50113/transform-quaternion/

The easiest way to convert to yaw-pitch-roll is to take the quaternion and create a Matrix3x3:

Let q be the quaternion of the current odom transform
tfScalar yaw, pitch, roll;
tf::Matrix3x3 mat(q);
mat.getEulerYPR(&yaw, &pitch, &roll);

(Note that the tfScalar type is usually typedef'd to double in scalar.h. Also see http://docs.ros.org/api/tf/html/c++/classtf_1_1Matrix3x3.html.)