Skip to content

MechanicsFrames and Kinematics

Coordinate Frames

A point seen by the robot becomes a point on the map by a rotation and a shift.

Not started Jump to practice

The robot's distance sensor says, "Obstacle 1 meter ahead." Where is that on the map? It depends on where the robot is and which way it faces.

Key idea

A frame is a point of view: an origin and axes. A point $(x_r, y_r)$ in the robot's frame, for a robot at $(x, y)$ facing angle $\theta$, is on the map at
$x_m = x + x_r\cos\theta - y_r\sin\theta$, $\ y_m = y + x_r\sin\theta + y_r\cos\theta$. Rotate, then shift.
Move and turn the robot. The point its sensor sees stays fixed in the robot's frame but moves on the map.

Why it works

The rotation is a matrix multiplication, the same one taught on the Math Ladder. Robots chain many of these: camera to body, body to map. Every one is rotate, then shift.

Worked example: Straight ahead

Robot at (2, 1) facing 90Β° (straight up the map). Its sensor sees a point 1 m ahead: $(1, 0)$ in its frame.
  1. $\cos 90^\circ = 0$, $\sin 90^\circ = 1$.
  2. $x_m = 2 + 1 \cdot 0 - 0 = 2$, $y_m = 1 + 1 \cdot 1 + 0 = 2$.

Answer: (2, 2).

Common mistake

Adding the robot's position but forgetting to rotate by its heading. That is only right when the robot faces along the map's $x$-axis.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.

Loading practice…

Builds on

Leads to

Sources and further reading