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).