# Twist message coordinate system convention

Trying to know what kind of coordinate system is using in twist message (angular velocities) is not clear to us what does "free space" refers to.

¿Is it refering to EULER ZYX convention? ¿Or Fixed Frame?

In the second case, we can create a Quaterion from EULER ZYX, and we would be interested to know if there is any method to extract the Fixed Frame coordinates from this quaternion.

Thanks a lot.

edit retag close merge delete

Sort by » oldest newest most voted To answer your direct question. Velocities are instantaneous and therefore there is no such thing as Euler notation vs fixed frame notation. Also note that quaternions represent orientations and are not appropriate for velocities.

You can convert between all the different conventions, Euler*, Fixed axis etc. You will also find that EulerZYX(YPR) and FixedXYZ(RPY) is conveniently the same three components.

more

"Velocities are instantaneous" is the key concept here to understand that the coordinate system has nothing to do in this case. Crystal clear now. Thanks a lot. See Coordinate Conventions, axis orientation for info on how ROS usually defines the axes of a coordinate system. Note that some applications may not follow those conventions (for example, UAVs often operate in a North-East-Down frame, so their positive z-axis points down, not up).

Since I'm not 100% sure what is unclear, let me give you some general Twist explanation and examples. Hopefully they can help answer your question.

When using a Twist message, you can interpret the components as follows:

• linear.x - translational velocity along the x-axis
• linear.y - translational velocity along the y-axis
• linear.z - translational velocity along the z-axis
• angular.x - rotational velocity about the x-axis
• angular.y - rotational velocity about the y-axis
• angular.z - rotational velocity about the z-axis

Translational velocities will have units like m/s and rotational velocities will have units like rads/s. Note that nowhere in there did we define which way those axes point - that is up to the reference frame that the Twist is relative to (see TwistStamped for a message that includes the header with frame_id in it as well as the Twist).

As an example that might help you have a more clear interpretation, assume for a moment we have a coordinate frame defined according to the above Coordinate Conventions that is fixed to the "origin" of a robot (often called the base_link frame). This frame is oriented such that positive x-axis points forwards, positive z-axis points upwards and the z-axis is on the center of rotation (dead center between the wheels and along the axle for a differential drive robot). This means that if we are interpreting a Twist relative to this reference frame, a command of linear.x = 1.0 means that the robot should move straight forward at 1.0 m/s. A command of angular.z = 1.0 means that the robot should spin at 1.0 rads/s about the center of rotation (this would correspond to yaw).

more

Thanks a lot for the detailed explanation. All is clear now.