The answersDownload the PDF
Worksheet

U1.3 Truth and belief

The robot as a system · University · about 25 min

BugBotLab
NameClassDate

What this lesson is about

position() is the lab's overhead camera. odometry() is what the robot has, and it drifts.

Questions 6 marks in all

  1. [1 mark]Why is using position() as the input to a controller treated as cheating?

    1. AIt is the lab's overhead measurement of the robot, which a real robot does not have once it leaves the room
    2. BIt is less accurate than odometry()
    3. CIt reports the position in the body frame, not the world frame
    4. DIt updates too slowly to be used inside a control loop
  2. [1 mark]A gyro reads 0.4 degrees per second too high. Integrated for 90 seconds, how many degrees of heading error does that bias alone produce?

  3. [1 mark]How do the two kinds of sensor error grow when dead reckoning integrates them?

    1. AZero-mean noise grows with the square root of time; bias grows linearly with time
    2. BNoise grows linearly with time; bias grows with the square root of time
    3. CBoth grow linearly with time
    4. DNoise averages away completely; only bias grows
  4. [1 mark]Driving a square, the heading error gets a little bigger at every corner. Why does that matter more than a position error of the same size?

    1. AA heading error rotates every step taken after it, so a small error at a corner becomes a large position error down the next straight
    2. BThe gyro bias only acts while the robot is turning
    3. CThe flow sensor is noisier while turning than while driving straight
    4. Dodometry() restarts its count at each corner
  5. [1 mark]Driving the same square with set_noise(0), odometry() and position() agree exactly, yet the robot still has not come back to where it started. What does that show?

    1. Aset_noise() changes the sensors, not the drive: the drive still curves, and the robot now measures the curve exactly
    2. Bset_noise(0) also turns off the drive's coupling, so the square is perfect
    3. Codometry() stops working when the noise is off
    4. DThe gyro bias is still switched on
  6. [1 mark]At the end of a run, odometry() gives (12.0, 118.5) and position() gives (15.0, 114.5). What does this print?

    import math
    ox, oy = 12.0, 118.5
    tx, ty = 15.0, 114.5
    print("error:", round(math.hypot(ox - tx, oy - ty), 1))

The task: how far out is it?

Drive at least 120 cm, with at least one turn in it. At the end, print how far odometry() is from position(), as error: 4.3.

from bugbot import *
connect()

forward(70, distance=50)

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/u1-3-truth-and-belief/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Do the same run with set_noise(0), set_noise(1) and set_noise(3). Tabulate the error.
  2. Drive 200 cm in a straight line, then 200 cm as four 50 cm legs with three turns. Which ends further out, and why?
  3. Print the heading error separately from the position error. Which one would you rather fix?