Ask Your Question
0

Values in nav_msgs/Odometry.msg corresponds to orientation

asked 2017-08-24 17:08:57 -0500

apples92 gravatar image

I am implementing the sampling algorithm (sample_motion_model_odometry) from Thrun's Probabilisitic Robotics book p. 136, which samples the current pose of a robot using odometry information.

I am wanting to test my implementation, and have access to a rosbag which has nav_msgs/Odometry.msg. However I am struggling to identify which column in this message would correspond to the odometry frame orientation theta. Any help in the matter would be much appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-08-24 17:52:03 -0500

jayess gravatar image

updated 2017-08-24 17:54:14 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-08-24 17:08:57 -0500

Seen: 590 times

Last updated: Aug 24 '17