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

Revision history [back]

The tf::Quaternion class is (currently) built on top of the Bullet quaternion class - here's an overview.

You have all the methods available in btQuaternion. You can also create a btMatrix3x3 from the btQuaternion and use any of the class methods.

After a quick scan, I'm seeing

  • getAngle()
  • getAxis()
  • getEulerYPR(..)
  • getEulerZYX(..)

The tf::Quaternion class is (currently) built on top of the Bullet quaternion class - here's an overview.

You have all the methods available in btQuaternion. You can also create a btMatrix3x3 from the btQuaternion and use any of the class methods.

After a quick scan, I'm seeing

  • getAngle()
  • getAxis()
  • getEulerYPR(..)
  • getEulerZYX(..)

EDIT: as per narcispr's comment:

Let's say q is your quaternion. This is what I usually do (there might be a more elegant way, but I havent found it)

tf::Matrix3x3 m(q);
double roll, pitch, yaw;
m.getRPY(roll, pitch, yaw)

The tf::Quaternion class is (currently) built on top of the Bullet quaternion class - here's an overview.

You have all the methods available in btQuaternion. You can also create a btMatrix3x3 from the btQuaternion and use any of the class methods.

After a quick scan, I'm seeing

  • getAngle()
  • getAxis()
  • getEulerYPR(..)
  • getEulerZYX(..)

EDIT: as per narcispr's comment:

Let's say q is your quaternion. This is what I usually do (there might be a more elegant way, but I havent haven't found it)

tf::Matrix3x3 m(q);
double roll, pitch, yaw;
m.getRPY(roll, pitch, yaw)
yaw);