ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Just to complete the previous example:
#include <tf/transform_datatypes.h>
// ...
tf::Quaternion q(quat.x, quat.y, quat.z, quat.w);
tf::Matrix3x3 m(q);
double roll, pitch, yaw;
m.getRPY(roll, pitch, yaw);
std::cout << "Roll: " << roll << ", Pitch: " << pitch << ", Yaw: " << yaw << std::endl;
Where quat contains the quaternion values to be transformed to roll, pitch, yaw.
2 | No.2 Revision |
Just to complete the previous example:response:
#include <tf/transform_datatypes.h>
// ...
tf::Quaternion q(quat.x, quat.y, quat.z, quat.w);
tf::Matrix3x3 m(q);
double roll, pitch, yaw;
m.getRPY(roll, pitch, yaw);
std::cout << "Roll: " << roll << ", Pitch: " << pitch << ", Yaw: " << yaw << std::endl;
Where quat contains the quaternion values to be transformed to roll, pitch, yaw.