The answersDownload the PDF
Worksheet

U2.4 Forward kinematics

Kinematics and frames · University · about 25 min

BugBotLab
NameClassDate

What this lesson is about

From the command to the body velocity to the path over the ground.

Questions 6 marks in all

  1. [1 mark]Put the stages of forward kinematics in order, from what you send to where the robot ends up.

    Number the lines 1 to 4 to put them in the right order.

    1. world velocity
    2. position over time
    3. body velocity, in cm/s
    4. command, in percent
  2. [1 mark]The forward kinematics predict a 3 s run at forward(70) for a robot at heading 30, with V_MAX = 20. What does this print?

    import math
    V_MAX = 20.0
    fwd, seconds, h_deg = 70, 3.0, 30
    v = (fwd / 100) * V_MAX
    h = math.radians(h_deg)
    print("predicted x:", round(v * math.sin(h) * seconds, 1))
    print("predicted y:", round(v * math.cos(h) * seconds, 1))
  3. [1 mark]With W_MAX = 120 deg/s, how many degrees does drive(0, 0, 25) turn the robot in 3 s, by the forward kinematics?

  4. [1 mark]A forward kinematics prediction of a straight run is close but not exact. Which of these does the lesson say the model leaves out?

    Tick every answer that is true.

    1. AThe lag as the robot speeds up at the start
    2. BThe coasting after the stop
    3. CThe sideways leak from driving forward
    4. DA gain that is not quite what the data sheet says
    5. EThe rotation matrix, which is only an approximation
  5. [1 mark]A turning robot's position is predicted by x += wx * dt using the heading at the start of each step. When does the choice between that and the exact arc matter?

    1. AWith a long step such as 0.5 s, because the heading changes a lot inside the step and the path is an arc, not a straight line
    2. BWith a short step such as 0.02 s, because the errors add up over more steps
    3. COnly when the robot is driving straight
    4. DNever, because the heading is updated at the end of every step anyway
  6. [1 mark]In stage two, which heading should rotate the body velocity into the world?

    1. AThe heading the robot has now, updated every step
    2. BThe heading at the start of the run
    3. CThe heading the robot will have at the end of the run
    4. DThe average of the starting heading and the target heading

The task: predict where it stops

Before driving, print where the forward kinematics say the robot will end up, as predicted x: and predicted y:. Then drive it and see. The robot does not start facing along an axis, so the rotation matters.

from bugbot import *
import math
connect()

# predict first, then drive

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

QR code
Do it on the robot
www.bugbotlab.com/learn/u2-4-forward-kinematics/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Predict a run with a turn in it by stepping the model at 0.1 s and updating the heading each step.
  2. Compare a prediction with a 0.02 s step against one with a 0.5 s step, for a robot that is turning.
  3. Improve the prediction by allowing for the quarter second of lag at the start. How much of the error does that explain?