Rosanswers logo

I am working on a robot. And currently I have no information about its actual speed, like from motors e. G. But the odom message has a field for twist. What will be the best thing to do:

  1. leave the twist with 0s
  2. calculate speed from past positions ... or
  3. use cmd_vel

Thanks for your help.

Originally posted by ct2034 on ROS Answers with karma: 862 on 2014-11-17

Post score: 3


1 Answer 1


Rosanswers logo

There are two places where the speed information in an odometry message is used:

navigation (move_base) uses the speed as the current speed of the robot, for computing the maximum commandable speed according to the acceleration limits. Setting a zero speed will confuse move_base and generally precent the local_planner from commanding the maximum velocity

A kalman filter (robot_pose_ekf, robot_localization) will usually use the velocity from the wheel encoders as one of the inputs to the kalman filter, which will integrate the velocity along with other measurements to produce an estimate of the robot's position. Again, using zeros here can cause the position estimates of your robot to be wrong.

If you can differentiate the wheel positions to produce a fairly clean, stable velocity estimate, that's probably more accurate than simply repeating the commanded velocity.

If there's a lot of noise in your differentiated wheel velocities, or if your wheel speed controller is not very accurate, using the calculated wheel velocities may cause the navigation controller to be unstable, and it may be wiser to repeat the commanded velocities.

Originally posted by ahendrix with karma: 47576 on 2014-11-17

This answer was ACCEPTED on the original site

Post score: 4


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.