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

Revision history [back]

In tf2 you would need to use one of the supported datatypes. Suppose the vector you are talking about is a geometry_msgs/Vector3, then you could use this version of doTransform to transform your vector using a geometry_msgs/TransformStamped to represent the rotation. In your case the transform would have zeros for the translational components and you would use your desired quaterion for the orientation portion. Also note, you could use the fromMsg and toMsg functions to convert between tf2 datatypes and any of the other supported datatypes.

Also, I'll point out that the * operator has been overloaded in several ways for the tf2 Quaternions such that you could also directly perform quaternion multiplication to accomplish the rotation you are describing. Example 1 and Example 2.