Step 1
Why odometry isn't enough
Model the wheels' noise, sample it 200 times, and watch the rover's possible poses spread into a banana as it drives.
Builds on Noise, mean, variance & bias, from the free Foundations.
Dead reckoning
The rover's wheels count how far it drove and how far it turned. Adding those increments up gives odometry, a pose that needs no other sensor. Between two readings the wheels report an increment , and the rover moves along its average heading : turn half, drive, turn the other half.
Every increment is a little wrong
Wheels slip, so each increment misses the real motion by a random amount. The errors add up like a random walk, so their variance grows in proportion to the motion:
and are independent standard normal numbers (np.random.randn). is the distance noise, the turning noise and the heading drift per metre; the program reads them from rover.config into NOISE .
A cloud of possible rovers
One noisy draw is one trip the rover might have made. Move 200 copies of the start pose, each with its own draw, and the cloud shows everywhere the rover could be. It grows as you drive, and small heading errors swing the position sideways, so it curves into a banana.
The program
The rover drives one lap of the loop, steering itself. Ten times a second your cloud moves by the odometry increment. Every half metre the cloud is drawn in yellow and the true rover in green; raw odometry is grey. The Plots tab shows the cloud's size and the odometry's real error against distance.
Your task
- Write
move(poses, ds, dth).posesis an (N, 3) array;dsanddthare numbers or (N,) arrays. Return the moved poses, with θ wrapped byrover.wrap. - Write
sample_motion(poses, u, noise): draw and for every pose, thenmovethem.
The grader checks both on fixed cases, then checks that the true rover ends inside your cloud. Nothing here looks at the world, so the cloud can only grow. The rest of the course fixes that.