How to record a route

asked 2014-05-17 19:46:51 -0600

Andrew.A gravatar image

I have a robot that can be driven, and I want to be able to record the route that the robot has moved. The robot moves in a similar manner to a car, it has a steering wheel, and the traction motor drives the shaft. For a robot with differential drive, this problem would be easy since I could make turning the robot be rotating on the spot. A route of driving in a square could be simply recorded in a textfile as:


where F stands for forward, and L stands for left, and the number represents the number of rotations of the wheel moved. Based on the route above, the robot simply moves in a square in an anticlockwise direction.

But with a robot with steering and no differential drive, I can't think of a way to record it simply. For the steering, we have a servo turning the steering shaft, so we can record this reading of the servo to know how much the steering wheel is turned.

At the moment, what I'm thinking of is basically just logging the reading of the servo, as well as the encoder (we have a rotary encoder at the drive shaft to know how far the robot has moved), every 0.1 seconds. For playback, we would then just set the servo value as per the recording every 0.1 seconds. However, I foresee lots of shortfalls because steering speed and driving speed can vary, and this may not be accurate enough. Would anyone know how to go about solving this problem?

edit retag flag offensive close merge delete