# What are the units of Odometry/orientation.z/w and Twist.angular.z fields?

I an new to ROS and am trying to understand the units in which the values in the Odometry.orientation.w and z fields and what do they represent. I am trying to rotate a turtlebot by a specific number of degrees. Is there a way to achieve it as I am able to set only angular velocities and whose unit I don't know either.

Originally posted by fayazvf on ROS Answers with karma: 21 on 2016-03-01

Post score: 1

Orientation is in terms of Quaternion, not Euler angles. You can check http://answers.ros.org/question/220333/what-do-x-y-and-z-denote-in-mavros-topic-mavrosimudata_raw/#220356

For unit conventions you can check REP-0103. As you can check, angular velocity is rad/s if the code you use is convenient with REP-0103.

Originally posted by Akif with karma: 3561 on 2016-03-01

This answer was ACCEPTED on the original site

Post score: 5

The orientation in ROS is (mostly) displayed as a quaternion. As such, it does not really have any units. You can, however, derive an angular representation (e.g. roll/pitch/yaw) from this, using one of the Rotation Methods, which then have radians as a unit.

• Python, from nav_msgs/Odometry, where msg is the full odometry msg:

  (roll, pitch, yaw) = tf.transformations.euler_from_quaternion([msg.pose.pose.orientation.x, msg.pose.pose.orientation.y, msg.pose.pose.orientation.z, msg.pose.pose.orientation.w])

• C++, from nav_msgs/Odometry, where msg is the full odometry msg:

  tf::Quaternion q(msg.pose.pose.orientation.x, msg.pose.pose.orientation.y, msg.pose.pose.orientation.z, msg.pose.pose.orientation.w);
tf::Matrix3x3 m(q);
double roll, pitch, yaw;
m.getRPY(roll, pitch, yaw);


(There are several more ways to do this. If someone has more efficient ones, please share.)

The Twist has units of m/s for the linear terms, as well as radian/s for the angular terms.

Originally posted by mgruhler with karma: 12390 on 2016-03-01

This answer was NOT ACCEPTED on the original site

Post score: 2