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'm not sure why or how you're using actionlib; can you share a bit of your code?

The trouble here is that, due to the time it takes for the robot to accelerate and decelerate, friction, minor timing errors, and wheel slip, the robot won't move exactly 3 meters if you send it a velocity command of 1m/s for 3 seconds. What you're doing is called open-loop control.

The solution to this is to do closed-loop control; that is, to create a feedback loop between the desired and actual position of the robot, and to send velocity commands which reduce that error. For a first version, you can subscribe to the robot's position on the odometry topic. This will give you the robot's position according to the wheel encoders, which will compensate for acceleration, friction and timing errors, but won't compensate for wheel slip. Compensating for wheel slip is much harder, because you need some sort of map and localization or SLAM.