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

It seems that creating a Matrix3X3 from the quaternion is not necessary since a transform already contains the rotation matrix. If you are working with TF, inside every Quaternion there is a Matrix3x3 called m_basis. When you call Transform::getRotation(), what you get is

From http://docs.ros.org/indigo/api/tf/html/c++/Transform_8h_source.html :

00120         Quaternion getRotation() const { 

00121                 Quaternion q;

00122                 m_basis.getRotation(q);

00123                 return q;

00124         }

So it could be that you may get away with:

transform.getBasis().getRPY(roll, pitch, yaw);

right?

It seems that creating a Matrix3X3 from the quaternion is not necessary since a transform already contains the rotation matrix. If you are working with TF, inside every Quaternion there is a Matrix3x3 called m_basis. When you call Transform::getRotation(), what you get is

From http://docs.ros.org/indigo/api/tf/html/c++/Transform_8h_source.html :

00120         Quaternion getRotation() const { 

00121                 Quaternion q;

00122                 m_basis.getRotation(q);

00123                 return q;

00124         }

So it could be that you may get away with:

transform.getBasis().getRPY(roll, pitch, yaw);

right?