Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Short answer: there is no column in the message that corresponds to the odometry frame orientation theta.

Long answer: ROS messages can be similar to Russian nesting dolls in that they are composed of messages, which are composed of messages, which are composed of messages, etc. So, sometimes it takes some digging to get to the information that you're looking for.

According to the api, the nav_msgs/Odometry is structured as follows:

# This represents an estimate of a position and velocity in free space.  
# The pose in this message should be specified in the coordinate frame given by header.frame_id.
# The twist in this message should be specified in the coordinate frame given by the child_frame_id
Header header
string child_frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/TwistWithCovariance twist

The orientation is buried within the pose attribute of the message which is of the type geometry_msgs/PoseWithCovariance. If you go to the api that I linked to and keep clicking the links that are listed under the Compact Message Definition section you'll eventually find that the orientation is given as a geometry_msgs/Quaternion.

The geometry_msgs/Quaternion api shows that the orientation is given as a quaternion (the name also gives that away too). For information on how to use quaternions, see this tutorial from the ROS wiki and this answer.

Short answer: there is no column in the message that immediately corresponds to the odometry frame orientation theta.

Long answer: ROS messages can be similar to Russian nesting dolls in that they are composed of messages, which are composed of messages, which are composed of messages, etc. So, sometimes it takes some digging to get to the information that you're looking for.

According to the api, the nav_msgs/Odometry is structured as follows:

# This represents an estimate of a position and velocity in free space.  
# The pose in this message should be specified in the coordinate frame given by header.frame_id.
# The twist in this message should be specified in the coordinate frame given by the child_frame_id
Header header
string child_frame_id
geometry_msgs/PoseWithCovariance pose
geometry_msgs/TwistWithCovariance twist

The orientation is buried within the pose attribute of the message which is of the type geometry_msgs/PoseWithCovariance. If you go to the api that I linked to and keep clicking the links that are listed under the Compact Message Definition section you'll eventually find that the orientation is given as a geometry_msgs/Quaternion.

The geometry_msgs/Quaternion api shows that the orientation is given as a quaternion (the name also gives that away too). For information on how to use quaternions, see this tutorial from the ROS wiki and this answer.