srinivas.siteApplied RoboticsUnit 09

Unit 09 · Phase 3 · Frames & Software

Vectors and coordinate frames

Mission: Help the rover find the direction to a fixed room marker: describe it relative to the rover, then transform three chosen markers to rover coordinates and back.

The interactive version of this unit needs JavaScript. Below are its steps as text.

Steps

1. The marker stays put

Press the button to switch from the room description to the rover description. Watch the marker, not the numbers.

Why it matters: A coordinate frame supplies an origin and oriented axes for a description. The point itself does not move when the reference changes.

2. Start at the room origin

Press the button to draw the room axes and the path to the marker.

Why it matters: A point is a location relative to an origin. Here world x points right and world y points up.

3. Find the rover origin

Press the button to reveal the rover origin relative to the room.

Why it matters: Translation describes the offset between origins. The rover origin is a point in room coordinates.

4. Subtract the origins

Press the button to draw the arrow from rover origin to marker, using room directions.

Why it matters: A position difference is a vector: it describes displacement, not a point with its own origin. Subtracting two points removes the common origin.

5. Which way is forward?

Press the button to turn the rover axes from room alignment to the shown heading.

Why it matters: Orientation tells us how one set of axes is turned relative to another. Rover +x is forward and +y is left.

6. Read the same arrow

Press the button to resolve the displacement along rover forward and left.

Why it matters: Changing components into turned axes uses the inverse rotation. A negative left component means right.

7. Combine the operations

Press the button to show subtraction followed by the axis change.

Why it matters: A frame transform here subtracts the rover origin first, then rotates the displacement into rover axes. The order matters.

8. Return to the room

Press the button to rotate the rover components back and add the rover origin.

Why it matters: The inverse operation reverses both the operations and their order. Rotate into room directions, then add the origin.

9. Degrees or radians?

Press the button to compare axes made by mistakenly passing 90 radians with the intended 90°; watch the solid axes correct to π/2 radians.

Why it matters: JavaScript trigonometric functions take radians. Supplying 90 as radians is a different angle, even though a consistently wrong inverse may still round-trip.

10. Mark three points

Press the button to trace the three simulated displacements to markers at (3, 2) m, (2, 3) m and (0, 1) m.

Why it matters: Different points exercise different signs and directions. The notebook lets you choose your own simulated points instead.

11. Round-trip the markers

Press the button to transform each marker into rover coordinates and back.

Why it matters: Round-trip error is the distance between the original and reconstructed room points. A small error checks inverse consistency, not the correctness of a shared wrong convention or real-world accuracy.

12. Your simulation record

Press the button to trace the three example comparisons, then open Notebook and enter a pose and three chosen points.

Why it matters: The target is curriculum evidence for chosen examples, not automatic certification. Check a known orientation independently and investigate degrees, radians and rotation direction if it fails.

Go deeper

Optional: the matrix form

R(θ) = [ cos θ  −sin θ ; sin θ  cos θ ]
p_R = R(θ)ᵀ (p_W − t)
p_W = t + R(θ) p_R

R describes rover axes in room coordinates; θ is counterclockwise. JavaScript Math.sin and Math.cos require radians: θrad = θdeg × π / 180. SVG coordinates grow downward, so the drawing explicitly reverses the vertical axis.

Limits and references

This ideal rigid 2D model omits sensor, map, calibration and real-world measurement errors. A round trip tests inverse consistency only.