Odometry and drift · University · about 35 min
A steady command is a twist, a turn about one point. The exact odometry step, the matrix exponential behind it, and the logarithm that plans one smooth arc.
The green square is 25 cm to the robot's right and 30 cm ahead of it. The robot must arrive in it facing 120 degrees (a third of a turn clockwise), using one steady drive() command held for T = 3 seconds, then stop(). Work out the twist with the logarithm, print it as a line starting twist: with w = ..., vx = ... and vy = ... (deg/s and cm/s), turn it into a command with the full-scale speeds below, and drive it. The printed twist is checked against the logarithm, to a tenth.
from bugbot import * import math connect() V_MAX, V_LAT, W_MAX = 20.0, 15.0, 120.0 # the design's full-scale speeds: cm/s forward, cm/s sideways, deg/s DX, DY, TURN = 25.0, 30.0, 120.0 # where to end up, in the start's body frame, and how far to turn T = 3.0 # how long to hold the command, s
Plan your program here, then type it in and press Run.
exp(A) exp(B) is not exp(B) exp(A) in general. Turn 90 degrees and then drive 20 cm, or drive 20 cm and then turn 90 degrees: work out both end poses with exact_step, then drive both. Why are they different, and which pairs of moves give the same answer in either order?exact_step and repeat the long lap from the project. How much of the final error was the integration?