Metatransformer report
Vectors and reference frames
Foundation · 60 minutes · Represent direction as well as magnitude and transform simple 2D observations so a robot can interpret a camera or sensor mounted at an angle.
Text report: images and diagrams are omitted, and links to project files are inactive. Keep the exported project alongside this PDF for wiring diagrams, models, and linked files.
Learning outcomes
- Resolve and rotate a 2D vector between named coordinate frames while checking direction, magnitude, and sign.
Prerequisites
- algebra-trig
Concepts
A scalar has magnitude only: 2 metres, 5 seconds, 12 volts. A vector also has direction. “The toy car moved 2 m” is incomplete for mapping; “2 m east” can be represented by components such as [2, 0] in a frame whose x-axis points east and y-axis north. Components are not intrinsic labels on the motion. They depend on the chosen coordinate frame.
In two dimensions, a vector of magnitude r at angle θ from +x has components x = r cos θ and y = r sin θ. Its magnitude is sqrt(x² + y²). To express a vector from a sensor frame in a body frame rotated by θ, use the rotation matrix R(θ) = [[cos θ, -sin θ], [sin θ, cos θ]]. Multiplying R by the component column rotates the description. Translation is separate: a direction vector is rotated but not shifted, while a point measured from a camera may need both rotation and the camera's position offset.
This distinction drives mounting decisions. A camera facing 90° left of a robot cannot feed its “forward” coordinate directly into robot forward motion. If the camera reports an object 0.40 m along its own forward axis, the body-frame vector is approximately [0, 0.40] m under the stated axis convention. Explicit frame names—camera, body, world—prevent silent sign errors.
A common misconception is that the same pair of numbers describes a vector in every frame. Another is adding a position offset to a velocity or force vector merely because both are drawn as arrows. Name each frame, draw positive axes, state whether the quantity is a point or free vector, and check that rotation preserves magnitude. If the length changes during a pure rotation, the calculation is wrong.
Worked example
Problem
A range sensor points 30° left of a toy car's forward +x axis and reports an obstacle 0.80 m straight ahead in its sensor frame. Find the body-frame components, ignoring sensor position offset.
Steps
- Represent the sensor reading as [0.80, 0] m in the sensor frame.
- Rotate by +30°: x = 0.80 cos 30° = 0.693 m.
- Compute y = 0.80 sin 30° = 0.400 m, where +y was defined as left.
Result
The obstacle vector is approximately [0.693, 0.400] m in the car body frame.
Sanity check
sqrt(0.693² + 0.400²) ≈ 0.800 m, so the pure rotation preserved distance; both components are positive for forward-left.
Check your understanding
A robot's body frame has +x forward and +y left. Which body vector describes 0.5 m directly to its right?
A. [0, -0.5] m B. [0, 0.5] m C. [-0.5, 0] m D. [0.5, 0] m
Your answer: ______________________________
Reasoning:
Answer key
ANSWER KEY — check only after attempting the question.
A. [0, -0.5] m
Right is opposite the declared +y direction, hence [0, -0.5] m. [0, 0.5] points left. The other choices lie on the forward/back x-axis. The diagnostic issue is frame convention, not the magnitude.
Hands-on lab
Goal
Map a sensor-relative direction into a toy-car body frame.
Equipment
- toy car or paper car outline
- phone camera used only to document
- protractor
- ruler
- masking tape
- small block
Procedure
- Tape body +x and +y axes on a table and mount or draw a sensor direction 45° left of body +x.
- Place the block 300 mm along the sensor axis and predict its body x/y coordinates.
- Measure the actual table coordinates from the body origin and record deviations separately for x and y.
- Deliberately flip the sign of the sine term; plot that faulty prediction and diagnose it from the mirrored side of the car.
- Move the sensor origin 50 mm forward and decide which coordinate receives the translation offset.
What to observe
- Expected before translation: x and y are each about 212 mm; actual values reflect drawing and placement tolerances.
- Expected fault clue: a sine-sign error preserves distance but places the block on the wrong side, unlike a scale error.
Transfer challenge
Sketch frames for a printer head, its carriage, and the page; state which transform would locate a nozzle point on the page.
Cautions
- Keep the tabletop area clear so the taped axes do not create a trip or snag hazard.
- Do not use a moving powered car during this geometry exercise.
Evidence record
Learner: ____________________ Date: ____________________
Evidence artifact or file: ____________________________________________
| Item | Record |
|---|---|
| Prediction or expected result | |
| Actual observation or measurement | |
| Conditions and tools used | |
| Difference from expectation | |
| Next decision or follow-up |
Notes: