ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
When using the TF library, you can use the method tf::quatRotate to rotate your vector by the rotation represented by the quaternion. E.g. the following code rotates your vector by 180 degrees around the x axis:
tf::Quaternion rotation(1, 0, 0, 0);
tf::Vector3 vector(0, 1, 0);
tf::Vector3 rotated_vector = tf::quatRotate(rotation, vector);
Don't forget to include tf/tf.h
.