ROBOTECA FREE SAMPLE
Dashboard

A free lesson from Robotics & ROS 2: the whole module, nothing cut short.

LESSON · Autonomous Mobile Robotics

Coordinate frames in robotics

Turn 1 35 min LESSON

ALearning Material

Everything in robotics has a position and orientation, and those are only meaningful relative to a reference frame: a chosen origin and set of axes. A lidar reports a point 'two metres ahead' in the lidar's frame‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍; the robot is at some pose in the world frame; the wheel turns in the robot's frame. Robotics is, to a large extent, the discipline of keeping track of frames and converting between them, and most 'the robot thinks the obstacle is in the wrong place' bugs are really a frame mistake. This lesson establishes coordinate frames and frame transformations: the geometric backbone of the whole topic.

A coordinate frame is a reference: an origin (a point that is '(0,0,0)') and a set of axes (directions) against which you measure position (where something is) and orientation (which way it faces). The insight is that a position like '(2, 0)' is meaningless on its own. It's '(2, 0) in which frame?'. The same physical point has different coordinates in different frames. So robots use several frames at once: a sensor frame (e.g. the camera's), the robot/body frame (often called base_link, fixed to the robot), and the ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍world/map frame (fixed to the environment), and you constantly convert coordinates from one frame to another (a frame transformation) to relate what a sensor sees to where the robot is in the world.

Everything is in some frame; robots juggle several and convert between them:

A FRAME = an ORIGIN (the (0,0,0) point) + AXES (directions) -> measures POSITION + ORIENTATION
KEY: a position '(2, 0)' is meaningless without a frame - '(2,0) in WHICH frame?' (same point, different coords per frame)

TYPICAL ROBOT FRAMES:
  - SENSOR frame (e.g. camera/lidar) - where the sensor measures from
  - ROBOT/BODY frame (base_link) - fixed to the robot (moves with it)
  - WORLD/MAP frame - fixed to the environment (the robot moves within it)
LOCAL (body/sensor - moves with the robot) vs GLOBAL (world/map - fixed)

FRAME TRANSFORMATION: convert a point's coordinates from one frame to another (sensor -> robot -> world)
  -> this is how 'the lidar sees a point 2 m ahead' becomes 'an obstacle at (x,y) on the map'

The disciplines. A frame is an origin plus axes measuring ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍position and orientation; a coordinate is meaningless without its frame (same point, different coordinates in different frames). Robots use a sensor frame, a robot/body frame (base_link, moving with the robot), and a world/map frame (fixed to the environment): distinguishing local frames (body/sensor, which move with the robot) from global frames (world/map, fixed). A frame transformation converts a point's coordinates from one frame to another (sensor -> robot -> world), which is how 'the lidar sees a point 2 m ahead' becomes 'an obstacle at (x, y) on the map'. The habits: always know which frame a quantity is in, use the right frame for each job (sensor for measuring, robot for moving, world for goals), and transform between frames to relate them. Frames are the geometric language of robotics.

Why it exists. A robot's sensors, body, and goals are each naturally described in their own reference frame, and to act sensibly the robot must relate them. Turn what a sensor measures (in the sensor's frame) into where that is in the world (in the world frame), and where to move (robot frame). Coordinate frames and the transformations between them are the precise machinery for this; without them, positions and orientations are ambiguous and the robot literally cannot know where anything is. So frames are the indispensable geometric foundation, which is why the topic establishes them before kinematics, perception, and navigation, all of which constantly use them.

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍Mental model. Frames are like giving directions relative to different landmarks. 'Two blocks north of me' (your frame) and 'two blocks north of the station' (the station's frame) describe different places even though the words are the same. The directions only mean something once you say what they're relative to. A robot is constantly translating between such viewpoints: 'the obstacle is 2 m ahead of my camera' must become 'the obstacle is at this spot on the map' before the robot can plan around it, exactly like translating 'left of me' into 'east of the station' so someone else can use it. Knowing the relationship between the landmarks (frames) is what lets you convert.

Common misunderstandings.

  • "A position is just a set of numbers." A position is numbers plus a frame: '(2, 0)' alone is ambiguous ('in which frame?'); the same physical point has different coordinates in different frames. Always state (or know) which frame a position/orientation is in. A 'frameless' coordinate is a bug waiting to happen.
  • ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍"There's one coordinate system for the whole robot." Robots use many frames at once (each sensor, the body, the world) because each thing is naturally measured in its own frame. The work is converting between them (transformations), not forcing everything into one.
  • "Local and global frames are interchangeable." A local frame (body/sensor) moves with the robot; a global frame (world/map) is fixed. They answer different questions ('where relative to me?' vs 'where in the world?') and you must transform between them. Confusing them puts obstacles or goals in the wrong place.

Connections. Frames are the backbone of the topic: the transform tree (map -> odom -> base_link -> sensor) in localization (the Nav2 SLAM lesson) is exactly these frames and their transformations (and ROS 2 tf2 is the tool that manages them); rotations & homogeneous transformations (next lesson) are the math of converting between frames; odometry estimates the robot frame's pose in the world frame; ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍perception turns sensor-frame measurements into the world/map frame to build costmaps (the perception/costmaps lesson); and 'always know your frame' is the single habit that prevents the most common navigation bugs.

BImmediate Active Recall

QUERY

What is a coordinate frame, and why is a position meaningless without one?

REVEAL
ANSWER

A coordinate frame is a reference: an origin (the point that counts as '(0,0,0)') plus a set of axes (directions), against which you measure position (where something is) and orientation (which way it faces). A position is meaningless without a frame because a coordinate like '(2, 0)' only says 'two along the first axis, zero along the second', but from which origin, along whose axes? The ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍same physical point has different coordinates in different frames (2 m ahead of the camera is a different '(2,0)' than 2 m from the world origin). So a coordinate is really 'numbers in a particular frame'. State the frame or it's ambiguous.

Did you recall it?
QUERY

What frames does a typical robot use, and what's the difference between local and global frames?

REVEAL
ANSWER

Typically a sensor frame (e.g. the camera's or lidar's, where that sensor measures from), a robot/body frame (base_link, fixed to the robot, moving with it), and a world/map frame (fixed to the environment, which the robot moves within). ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍Local vs global: a local frame (body or sensor) moves with the robot. It answers 'where is this relative to me/my sensor?'; a global frame (world/map) is fixed. It answers 'where is this in the world?'. Both are needed (measuring and moving happen in local frames; goals and maps live in the global frame), and you transform between them.

Did you recall it?
QUERY

What is a frame transformation, and why does a robot need them?

REVEAL
ANSWER

A frame transformation converts a point's (or pose's) coordinates from one frame to another‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍, e.g. taking a point measured in the sensor frame and expressing it in the robot frame, then in the world/map frame (sensor -> robot -> world). A robot needs them because its sensors, body, and goals are each in their own frame, and to act it must relate them: 'the lidar sees a point 2 m ahead' (sensor frame) must become 'an obstacle at (x, y) on the map' (world frame) before the robot can plan around it. Transformations are the machinery that ties the frames together so measurements, motion, and goals can be combined.

Did you recall it?
QUERY

Why is 'always know which frame a quantity is in' such an important habit?

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍REVEAL
ANSWER

Because a quantity in the wrong frame is wrong, and silently so. If you treat a sensor-frame measurement as if it were in the world frame (or mix up local and global), the robot places the obstacle or goal in the wrong spot, and it looks like a perception or planning bug when it's really a frame mistake. Since the same point has different coordinates in different frames, every position/orientation only makes sense paired with its frame, so knowing (and converting) frames correctly is what keeps the robot's picture of the world consistent. 'Which frame is this in?' is the first question to ask of any robotics coordinate, and it prevents the most common navigation bugs.

Did you recall it?

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍CConceptual Questions

Answer each in your own words in the box, then reveal the model answer to compare. These ask why, not how, and your answers are saved.

PROMPT

Why is the idea that 'every position and orientation is relative to a frame' so fundamental to robotics, and why must a robot use several frames at once rather than one global coordinate system?

REVEAL MODEL ANSWER
MODEL ANSWER

The idea that every position and orientation is relative to a frame is fundamental to robotics because spatial quantities have no meaning in the absolute‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍. A position is always a position relative to some origin and axes, and getting this relationship right is the entire basis of a robot knowing where anything is. Consider what a coordinate actually is: '(2, 0)' means 'two units along the first axis and zero along the second, starting from the origin'. But that is only meaningful once you specify which origin and which axes. That is, which frame. The very same physical point in space has different coordinates in different frames: a chair might be at (2, 0) relative to the robot's camera, at (1.5, 0.3) relative to the robot's body, and at (7.2, 4.1) relative to the world origin, three different coordinate triples, all describing the one chair. So a coordinate without a frame is genuinely meaningless (or worse, ambiguous: it looks like a definite location but isn't). This is why 'relative to a frame' is foundational: it's not a technicality, it's what makes spatial data mean anything. A robot's entire grasp of space (where it is, where obstacles are, where its goal is, which way it's facing) rests on coordinates, and every one of those coordinates is only correct in a particular frame‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍. Get the frame wrong and the number, however precise, points to the wrong place. A robot must use several frames at once, rather than one global coordinate system, because each thing it deals with is naturally described in its own frame, and forcing everything into a single frame would be both unnatural and impossible to maintain directly. A sensor measures in its own frame: a camera or lidar inherently reports where things are relative to itself (it has no direct knowledge of the world origin): 'a point 2 m ahead of me'. The robot's body has its own frame (base_link) in which its motion, its wheels, and its parts are naturally described. The robot moves and turns, so 'forward' and 'left' are most naturally expressed relative to the body. And the world/map has a fixed frame in which the map, goals, and global positions live, because you want the map and destination to stay put as the robot moves. These frames are moving relative to each other: as the robot drives, its body frame and sensor frames move continuously within the fixed world frame. You cannot just pick one global frame and put everything in it directly, because the sensor physically measures in its own frame and the robot ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍physically moves in its body frame. The data is born in those local frames. What you can do (and must) is know the relationships between the frames, the transformations, and convert as needed: take the sensor's measurement (in the sensor frame), transform it through the body frame into the world frame to place the obstacle on the map; take the goal (in the world frame), transform it into the body frame to decide how to drive toward it. So robotics uses many frames because the sensors, the body, and the world are each intrinsically their own frame, and the robot's job is to relate them by transformation, which is exactly why frames and frame transformations are the geometric backbone of everything: kinematics (relating wheel/joint motion in the body frame to motion in the world), perception (sensor frame to map frame), localization (tracking the body frame's pose in the world frame), and navigation (goals in the world frame, control in the body frame) are all about expressing and converting spatial quantities between the right frames. Mastering 'everything is relative to a frame, and we convert between frames' is mastering the language in which all of robotics is spoken.

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍Compared to the model answer - did you get it?
PROMPT

Why are most 'the robot thinks the obstacle/goal is in the wrong place' problems actually frame errors, and what does this reveal about the discipline frames impose?

REVEAL MODEL ANSWER
MODEL ANSWER

Most 'the robot thinks the obstacle or goal is in the wrong place' problems are actually frame errors because placing something in space requires both a measurement and the correct frame relationship to express that measurement in the frame you're reasoning in, and since the measurement itself is often fine, the thing that silently goes wrong is the frame conversion. Think about how an obstacle gets onto the robot's map: the lidar correctly measures a point '2 m ahead' in the ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍lidar frame; to put it on the map, that point must be transformed from the lidar frame, through the robot body frame, into the world/map frame, using the current relationships between those frames (where the lidar is mounted on the body, and where the body currently is in the world). If any of those frame relationships is wrong: the lidar's mounting transform is mis-specified, the robot's pose in the world is stale or wrong, an axis is flipped, units or angle conventions differ, or the wrong frame is assumed, then the correctly measured point gets placed at the wrong world location. The obstacle appears somewhere it isn't (a 'phantom' obstacle), or the real obstacle is mapped to the wrong spot, or the goal (specified in the world frame) is interpreted as if in the body frame and the robot drives to the wrong place. The sensor was working and the number was right. The error is purely in which frame the number was treated as being in, or how it was converted. That's why these bugs are so often frame errors: the spatial data pipeline is a chain of frame transformations, and a mistake anywhere in that chain corrupts the final position while leaving the raw measurement looking correct, so it ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍presents as a perception or planning fault ('the robot sees an obstacle that isn't there', 'the robot goes to the wrong place') but its cause is a frame mistake. What this reveals about the discipline frames impose is that spatial correctness is a bookkeeping discipline: you must, rigorously and always, know which frame every quantity is in, know the (current) relationships between your frames, and convert correctly and consistently between them. The frame framework is unforgiving in that a single inconsistency (a flipped axis, a wrong or stale transform, an assumed frame) doesn't throw an error. It just yields a confidently-wrong location. So frames impose the habit captured in the lesson: the first question to ask of any robotics coordinate is 'which frame is this in?', and the first thing to check when something is mis-located is the chain of transforms, not the sensor or the planner. This is also why robotics builds explicit machinery to manage frames rigorously. The transform tree and tools like ROS 2's tf2, which track all the frame relationships over time so conversions are done consistently and correctly. The deeper lesson is that because every spatial quantity is frame-relative and conversions are silent when wrong, robotics demands ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍disciplined frame bookkeeping as the foundation of spatial reasoning, and that internalising 'always know and convert frames correctly' prevents the single largest class of navigation and perception bugs, because those bugs are, more often than not, frames being wrong while the sensors and algorithms are blamed.

Compared to the model answer - did you get it?

DPractice Problems

P1 (easy). What is a coordinate frame, why is a position meaningless without one, and what is a frame transformation?

P2 (medium). Why is 'every position/orientation is relative to a frame' fundamental, and why must a robot use several frames at once?

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍P3 (harder). Why are most 'obstacle/goal in the wrong place' problems actually frame errors, and what discipline do frames impose?

Solutionsclick to reveal

P1. A coordinate frame is a reference: an origin (the '(0,0,0)' point) plus axes (directions), used to measure position (where something is) and orientation (which way it faces). A position is meaningless without a frame because '(2, 0)' only means 'two along the first axis, zero along the second': from which origin, along whose axes? The same physical point has different coordinates in different frames (2 m ahead of the camera is a different '(2,0)' than 2 m from the world origin), so a coordinate is really 'numbers in a particular frame'. State the frame or it's ambiguous. Typical robot frames: a ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍sensor frame (where a sensor measures from), a robot/body frame (base_link, moving with the robot), and a world/map frame (fixed to the environment), local frames (body/sensor) move with the robot, global (world/map) is fixed. A frame transformation converts a point's coordinates from one frame to another (sensor -> robot -> world). It's how 'the lidar sees a point 2 m ahead' (sensor frame) becomes 'an obstacle at (x, y) on the map' (world frame).

P1Compared to this solution - did you get it right?

P2. Why fundamental: spatial quantities have no absolute meaning‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍. A position is always relative to some origin and axes (a frame). '(2, 0)' means 'two along axis 1, zero along axis 2 from the origin', meaningful only once you say which origin/axes. The same point has different coordinates in different frames (a chair at (2,0) from the camera, (1.5,0.3) from the body, (7.2,4.1) from the world, all the one chair). So a frameless coordinate is meaningless/ambiguous, and a robot's whole grasp of space (where it is, where obstacles/goals are, which way it faces) rests on coordinates that are only correct in a particular frame; wrong frame -> the precise number points to the wrong place. Why several frames at once: each thing is naturally described in its own frame, and forcing one global frame is impossible directly. A sensor measures in its own frame (a camera/lidar reports relative to itself: 'a point 2 m ahead': it has no direct knowledge of the world origin). The body frame (base_link) is where the robot's motion/wheels/parts are naturally described ('forward'/'left' relative to the body). The ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍world/map frame holds the map, goals, and global positions (which should stay put as the robot moves). These frames move relative to each other as the robot drives. You can't put everything in one global frame directly because the data is born in local frames (the sensor measures there, the robot moves there), instead you know the relationships between frames (transformations) and convert (sensor -> body -> world to map an obstacle; world -> body to drive to a goal). So robotics uses many frames because sensors, body, and world are intrinsically their own frames, and the job is to relate them by transformation: the backbone of kinematics, perception, localization, and navigation.

P2Compared to this solution - did you get it right?

P3. Why they're frame errors: placing something in space needs both a measurement and the correct frame relationship to express it in the frame you reason in, and the measurement is often fine, so the silent failure is the frame conversion. To map an obstacle: the lidar correctly measures '2 m ahead' in the lidar frame; to put it on the map it's transformed lidar -> body -> world using the current frame relationships (lidar mounting on the body, body's pose in the world). If any relationship is wrong: mis-specified mounting transform, stale/wrong robot pose, a flipped axis, mismatched units/angle conventions, or an assumed wrong frame: the correctly-measured point lands at the wrong world location: a phantom obstacle, a real obstacle mapped to the wrong spot, or a ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍goal (world frame) misread as body-frame so the robot drives to the wrong place. The sensor worked and the number was right. The error is which frame it was treated as, or how it was converted. So these bugs present as perception/planning faults but their cause is a frame mistake, because the spatial pipeline is a chain of frame transformations and a slip anywhere corrupts the final position while the raw measurement still looks correct. The discipline frames impose: spatial correctness is a bookkeeping discipline: you must always know which frame every quantity is in, know the (current) relationships between frames, and convert correctly and consistently. The framework is unforgiving: a single inconsistency (flipped axis, stale/wrong transform, assumed frame) doesn't throw an error. It yields a confidently-wrong location. So the habits: the first question for any coordinate is 'which frame is this in?', and the first thing to check when something is mis-located is the ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍chain of transforms, not the sensor or planner. It's why robotics builds explicit machinery, the transform tree and tf2, to track all frame relationships over time and convert consistently. The point: because every spatial quantity is frame-relative and silent when wrong, robotics demands disciplined frame bookkeeping as the foundation of spatial reasoning. Internalising 'always know and convert frames correctly' prevents the single largest class of navigation/perception bugs.

P3Compared to this solution - did you get it right?

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍EFeynman Exercise

Explain to a beginner, using the analogy of giving directions relative to different landmarks ('two blocks north of me' vs 'two blocks north of the station'): (1) why a position is meaningless until you say what it's relative to (the frame), (2) why a robot naturally uses several frames (its sensors, its body, and the world) each measuring from its own viewpoint, and (3) why converting between frames (a transformation) is how 'the obstacle is 2 m ahead of my camera' becomes 'the obstacle is at this spot on the map'.

REVEAL MODEL ANSWER
MODEL ANSWER

Coordinate frames are best understood through giving directions relative to different landmarks. First, a position is meaningless until you say what it's relative to. If I say 'it's two blocks north of ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍me' and you say 'it's two blocks north of the station', we've used the same words but pointed at different places, because 'two blocks north' only means something once you say what it's relative to (me, or the station). It's the same with a robot: a position like '(2, 0)' is just numbers until you say which origin and which directions they're measured from. That reference is the frame, and the same spot has different numbers depending on which frame you use. Second, a robot naturally uses several frames: its sensors, its body, and the world: each measuring from its own viewpoint. A camera or lidar inherently reports where things are relative to itself ('2 m ahead of me'): that's the sensor frame. The robot's body has its own frame (forward, left, relative to the robot, which moves as the robot moves). And the world/map has a fixed frame, where the map and the goal stay put no matter how the robot drives. Each thing is naturally described from its own landmark: the sensor sees from the sensor, the robot moves relative to its body, the map is fixed to the world, so the robot juggles all of them. Third, ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍converting between frames is how 'the obstacle is 2 m ahead of my camera' becomes 'the obstacle is at this spot on the map'. Just as you have to translate 'left of me' into 'east of the station' before someone else can use your directions, the robot has to translate the obstacle's position from the camera's frame into the map's frame before it can plan around it - and to do that it needs to know how the frames relate (where the camera is on the robot, where the robot is in the world). That translation is a frame transformation. So: every position is relative to a frame (a landmark), a robot sees and moves and plans using several frames at once, and it constantly converts between them, and 'which frame is this in?' is the first question to ask, because most 'the robot put the obstacle in the wrong place' problems are really a frame mix-up, not a broken sensor.

Compared to the model answer - did you get it?

FError Analysis Framework

  • Treating a coordinate as a location without specifying its frame. Why: it's a precise number. Recognise: the same point has different coordinates in different frames. A frameless coordinate is ambiguous. Avoid: always pair a position/orientation with its frame ('which frame is this in?').
  • Trying to force everything into one global coordinate system. Why: one frame seems simpler. Recognise: sensors measure in their own frame and the body moves in its frame, data is born local. Avoid: use several frames and convert between them (sensor -> body -> world) via transformations.
  • Confusing a local (body/sensor) frame with a global (world/map) frame. Why: they're both coordinate systems. Recognise: local frames move with the robot; the global frame is fixed. They answer different questions. Avoid: transform between them; never treat a body/sensor-frame quantity as world-frame.
  • ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍Blaming the sensor or planner when an obstacle/goal is mislocated. Why: the obstacle appears in the wrong place. Recognise: the measurement is often right; a wrong/stale transform put it there. Avoid: check the chain of frame transforms first (frame errors are silent and the commonest cause).

GMini Challenge

Explain coordinate frames for a new roboticist: what a frame is, why a position is meaningless without one, the sensor/robot/world frames (local vs global), and frame transformations. Explaining why a robot uses several frames and why 'always know your frame' prevents the most common navigation bugs.

REVEAL MODEL ANSWER
MODEL ANSWER

What a frame is, and why a position needs one: a ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍coordinate frame is a reference (an origin (the '(0,0,0)' point) plus axes (directions)) against which you measure position and orientation. A position is meaningless without a frame: '(2, 0)' is 'two along axis 1, zero along axis 2', but from which origin, whose axes? The same physical point has different coordinates in different frames, so a coordinate is really 'numbers in a particular frame' (state the frame or it's ambiguous).

The sensor/robot/world frames (local vs global): a robot uses a sensor frame (where a sensor measures from), a robot/body frame (base_link, fixed to the robot: moves with it), and a world/map frame (fixed to the environment). Local frames (body/sensor) move with the robot ('where relative to me?'); the global frame (world/map) is fixed ('where in the world?'). Both are needed. Measuring and moving happen in local frames; maps and goals live in the global frame.

‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍Frame transformations: a transformation converts a point's coordinates from one frame to another (sensor -> robot -> world). It's how 'the lidar sees a point 2 m ahead' (sensor frame) becomes 'an obstacle at (x, y) on the map' (world frame), and how a goal (world frame) becomes 'drive this way' (body frame).

Why several frames: each thing is naturally described in its own frame: a sensor physically measures in its own frame, the robot moves in its body frame, the map/goals live in the fixed world frame: and these frames move relative to each other as the robot drives. The data is born local, so you know the relationships between frames and convert rather than forcing one global frame.

Why 'always know your frame' prevents bugs: a quantity in the wrong frame is silently wrong: treating a sensor-frame measurement as world-frame (or a stale/wrong robot pose, a flipped axis, mismatched units) puts the correctly-measured obstacle/goal in the wrong place‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍, looking like a perception/planning bug but really a frame mistake. Since conversions fail silently (a confidently-wrong location, no error), robotics demands disciplined frame bookkeeping: 'which frame is this in?' is the first question, and the chain of transforms is the first thing to check when something is mislocated. This is why robotics builds the transform tree and tf2 (the Nav2 SLAM lesson) to track frame relationships over time, and why frames are the geometric backbone of kinematics, perception, localization, and navigation. The math of converting between frames is the next lesson (rotations & homogeneous transformations).

Compared to the model answer - did you get it?

Quiz Check

A quick auto-graded check, separate from the recall cards above. Your score is pooled with the recall cards into this module's Mastery score, and ‍​‌‌​​‌‌​​‌‌‌​​‌​​‌‌​​‌​‌​‌‌​​‌​‌​​‌​‌‌​‌​‌‌‌​​‌‌​‌‌​​​​‌​‌‌​‌‌​‌​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​‌​‌‍completing this lesson requires the quiz submitted with pooled mastery at 80% or above.

QUIZAuto-graded check · feeds your mastery score
  1. A coordinate frame is:

  2. A position like '(2, 0)' is meaningless without a frame because:

  3. A frame transformation:

  4. Most 'obstacle/goal in the wrong place' bugs are really:

This is a free sample

Progress and the spaced-repetition reviews are part of the course. The full track continues from here.