Khepera III Toolbox/The Toolbox/Modules/odometry track

The odometry_track module implements the odometry equations for a differential-drive vehicle and allows to track the robot's position ($$x$$, $$y$$, $$\theta$$) over time. Fosamax Class Action blog

Description
odometry_track_start sets up a sOdometryTrack structure and reads the odometry calibration values from /etc/khepera/odometry. If that file is not available (or does not contain a valid configuration), default values are used. After calling this function, the initial position can be changed by modifying the result fields of the structure. odometry_track_start also reads the current motor positions and should therefore be called immediately before entering the main loop.

Inside the main loop, odometry_track_step is called to read the new motor positions and update the position estimate in the result fields.

Calibration
The default calibration values should give acceptable results on most Khepera III robots. Through a calibration procedure, the precision can be significantly improved, however.

Providing Motor Positions from Other Sources
The functions mentioned above read the motor positions automatically with the khepera3_drive_getposition function. If this is not desired, the functions odometry_track_start_pos and odometry_track_step_pos can be used.