this is the way how i have implemented a movement distance control on my 3rd robot vehicle. the point is that we can give a command (serial port or bluetooth...) to the robot, to move forward or backwards a specified (in the control applicacion) distance and then stop. this is based on using an accelerometer sensor and a digital signal processor.(maybe a microcontroller is also fine, i used a DSP)