Kinematics and frames · University · about 20 min
The robot's forward is not the world's forward. Naming the frame is half the work.
[1 mark]Which of these speak in the robot's body frame?
Tick every answer that is true.
[1 mark]A robot is at heading 90. Which way is it facing?
[1 mark]Heading 0 means the robot faces along which world axis? Give the axis and its sign.
[1 mark]A robot turns left, anticlockwise seen from above. What sign is the change in its heading?
[1 mark]A robot at heading 90 drives straight forward at 14 cm/s for 2 s. How far does its world x change, in cm?
[1 mark]A program sets command_lat = dx_world, where dx_world = target_x - x_world. What is wrong with it?
The robot starts facing along the world's x axis. Drive it forward at least 25 cm, then print two numbers: body: the average sideways speed in the robot's own frame while it drove, and world x: how far it actually moved along the world's x axis.
from bugbot import * connect() forward(60)
The hint students can ask for: The robot starts facing along the world's x axis. Drive forward for a few seconds. In the body frame that is forward; in the world frame it is x. Read flow() for one and position() for the other.
from bugbot import *
connect()
forward(70)
side = []
for i in range(30):
side.append(flow()[0])
wait(0.1)
stop()
wait(0.6)
x, y = position()
print("body:", round(sum(side) / len(side), 1))
print("world x:", round(x, 1))
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.