Ask Your Question

Revision history [back]

I have the feeling that you misunderstood, what odometry means.

Check out the Wikipedia article.

You don't publish the encoder data to nav_msgs/Odometry. You need to compute the current cartesian velocity (and also the current position estimate based on the velocity) based on the encoder readings. For this, you'll need to create a model of your robot that let's you compute this. Typical odometry models (corresponding to the kinematics) are differential, omni-directional, tricycle.

In ROS, there exist different base_controllers or base_drivers, that actually do this. Search a bit around to see how this is done therein.

I have the feeling that you misunderstood, what odometry means.

Check out the Wikipedia article.

You don't publish the encoder data to nav_msgs/Odometry. You need to compute the current cartesian velocity (and also the current position estimate based on the velocity) based on the encoder readings. For this, you'll need to create a model of your robot that let's you compute this. Typical odometry models (corresponding to the kinematics) are differential, omni-directional, tricycle.

In ROS, there exist different base_controllers or base_drivers, that actually do this. Search a bit around to see how this is done therein.therein. Also, have a look at this Tutorial.