ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I can rostopic echo /odom and see the x,y,z as well as x,y,z,w (which i guess are the quaterinion values). Is there any other way to fetching quaternion values ?

yes: lookup the transform between base_link of your robot and the odom or map frame.

if I rotate the robot to a position, check the quaternion (x,y,z,w) values, move it around and later come to the same position , the quaternion values are chaning every time. I'm not sure if this is a valid behaviour because as I know, if quaternion is a representation of rotation (or pose), then if the robot is in the same pose after moving around, it shouldn't change isn't it?

If you're just looking at /odom this can probably be explained by realising that most wheeled robots rely heavily on encoder ticks to calculate their odometry. Displacement (both pure translation as well as rotation) would then be the result of integration.

You probably know that due to wheel slip and other factors wheel-based odometry is far from ideal, so cumulative errors could lead to what you are seeing (ie: returning to "the same" position doesn't result in seeing the same odometry values).


To improve this situation, you may want to use a sensor fusion package like robot_localization. That takes in raw odometry measurements and transforms them into a better state estimate for your robot.

Note: this will most likely still not result in seeing the exact same values, but, properly tuned, should result in better estimates.