Odometry and drift · University · about 30 min
Noise walks, bias marches, scale stretches, and a heading error rotates everything after it.
[1 mark]The noise error in a dead reckoning run grows as a random walk. If the run is made twice as long, by what factor does that error grow? Give two decimal places.
[1 mark]Which of these errors grow in direct proportion to the time or distance driven, rather than with its square root?
Tick every answer that is true.
[1 mark]Gyro rates in deg/s are read while the robot stands perfectly still. What does this print?
rates = [0.3, 0.5, 0.2, 0.4, 0.1, 0.3]
mean = sum(rates) / len(rates)
spread = (sum((r - mean) ** 2 for r in rates) / len(rates)) ** 0.5
print("bias:", round(mean, 2))
print("noise:", round(spread, 2))
print("after 60 s:", round(mean * 60, 1))bias: 0.3 noise: 0.13 after 60 s: 18.0
The mean is 1.8 / 6 = 0.3 deg/s, which is the bias. The squared deviations sum to 0.1, so the spread is the square root of 0.1 / 6, about 0.13. The bias alone is 0.3 × 60 = 18 degrees after a minute.
[1 mark]Using the lesson's rule that driving d with a heading error of e radians puts you about d × e to one side, this works out the sideways error over 10 metres. What does it print?
import math
for deg in (1, 3, 10):
print(deg, round(1000 * math.radians(deg), 1))1 17.5 3 52.4 10 174.5
One degree is 0.01745 radians, so 1000 cm × 0.01745 = 17.5 cm. Three degrees gives 52.4 cm and ten gives 174.5 cm, from an error that costs nothing while the robot stands still.
[1 mark]The flow sensor reads 4 percent high. How many centimetres too far does dead reckoning put the robot after a 10 m straight run?
[1 mark]For this sort of ground robot over a run of a minute or two, which error source does the lesson rank as the most damaging?
Without moving the robot at all, print this gyro's bias as bias: 0.31, in degrees per second.
from bugbot import * connect() rates = []
The hint students can ask for: Stand still and read imu()[1] many times. The average of enough readings is the bias; the spread around it is the noise. Sixty readings is plenty and takes six seconds.
from bugbot import *
connect()
rates = []
for i in range(60):
rates.append(imu()[1])
wait(0.1)
print("bias:", round(sum(rates) / len(rates), 2))
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.