Skip to the lesson
FixTheRobot Explore Robotics / Navigation / M1 Navigation Foundations / M1-T4

Navigation · Theory · M1

M1-T4 — Frames, Poses and Footprints

Every navigation number lives in some frame. Mix them up and a perfect planner drives into a wall.

  • Lesson 4 of 6
  • Module 1: Navigation Foundations
  • Theory
  • About 9 minutes to read

A path, a goal, an obstacle and a robot are all positions, and a position means nothing without the frame it is measured in. Navigation uses at least three frames, and the way they are chained explains both how a robot can plan against a map and move smoothly while its position estimate is being corrected. This lesson also describes the robot’s body as a footprint, the shape every costmap and planner uses.

Learning objectives

After this lesson, you should be able to:

  • Name the map, odom and base frames and say which part of the system publishes each link.
  • Compose and invert 2D poses to express a point or a pose in another frame.
  • Explain why two world-fixed frames are used, and which one a planner and a controller should use.
  • Describe a footprint by its inscribed and circumscribed radii and place it in the map frame.

The intuition

Picture a ship at sea. The captain’s chart is fixed to the earth: that is the map. A dead-reckoning plot kept on the bridge, built from the log and the compass, is smooth and always up to date but slowly drifts: that is the odom frame. When a lighthouse is sighted, the navigator corrects the plot against the chart, and the plot’s position on the chart jumps by a few hundred metres. The ship itself did not move. Finally, the position of the galley on the ship does not change at all: that is the base frame.

A robot is organized the same way, for the same reason. Control needs a position that never jumps, because a jump looks like a huge velocity. Planning needs a position that is right on the map, because the goal is on the map. One frame cannot be both, so the correction between them is kept as its own link.

The map, odom and base framesA chain of three frames. The map frame is fixed to the world and can jump when localization corrects the pose. The odom frame is smooth but drifts. The base frame is attached to the robot. The map to odom transform comes from localization and the odom to base transform from odometry.mapfixed to the world odomsmooth, drifts base_linkon the robot localizationodometry jumps when correctedcontinuous, never jumps T_map_base = T_map_odom · T_odom_base Planners think in map. Controllers use odom for smooth motion. Costmaps are built in one frame and must say which.
The standard frame chain (ROS REP 105). Localization publishes the correction from map to odom; odometry publishes the smooth motion from odom to the robot’s base.

The mathematics

Poses and transforms in 2D

A 2D pose (x, y, θ) is also a transform: it says how to get from a parent frame to a child frame by rotating by θ and then shifting by (x, y). A point pb given in the base frame is pm in the map frame when

Point from base to map
pm=R(θ) pb+tp_{m}=R(\theta )\,p_{b}+t
R(θ)=[cos⁡ θ−sin⁡ θ]R(\theta )=[\cos \,\theta -\sin \,\theta ]
[ sin θ cos θ ]
t=(x, y)t=(x,\,y)

Chaining frames composes the transforms. If the pose of odom in the map is (xmo, ymo, θmo) and the pose of the base in odom is (xob, yob, θob), then the base pose in the map is

Composition of poses
θmb=θmo+θob\theta _{\text{mb}}=\theta _{\text{mo}}+\theta _{\text{ob}}
(xmb, ymb)=(xmo, ymo)+R(θmo)(xob, yob)(x_{\text{mb}},\,y_{\text{mb}})=(x_{\text{mo}},\,y_{\text{mo}})+R(\theta _{\text{mo}})(x_{\text{ob}},\,y_{\text{ob}})
TAB
the pose of frame B expressed in frame A.
R(θ)
the 2D rotation matrix. Rotating by θ then by φ equals rotating by θ + φ.
map → odom
published by the localization system. It changes in small steps or occasional jumps.
odom → base
published by odometry (wheel encoders, inertial sensor, or visual or LiDAR odometry). It is continuous.

The inverse of a pose expresses the parent in the child frame, which is how a robot turns a map goal into “three metres ahead and one to the left”.

Conventions

ROS uses x forward, y left and z up (REP 103), angles in radians counter-clockwise, and metres. The same conventions are used in this track. A different convention in one component, such as y pointing right, is a classic source of mirrored paths.

The footprint

Planners need the robot’s shape, but they cannot afford a full 3D model, so the body is reduced to a footprint: a polygon in the base frame, or a circle. Two radii summarize it.

Footprint with inscribed and circumscribed circlesA rectangular robot footprint 0.6 metres long and 0.4 metres wide, with the inscribed circle of radius 0.2 touching the long sides and the circumscribed circle of radius 0.36 through the corners. x r_in = 0.2 r_circ = 0.36 length 0.6 m × width 0.4 m, origin at the centre
A 0.6 m × 0.4 m rectangular footprint. The inscribed circle is the largest circle inside it; the circumscribed circle is the smallest circle that contains it.
Footprint radii
inscribed radius rin=the distance from the centre to the nearest edge\text{inscribed radius}\,r_{\text{in}}=\text{the distance from the centre to the nearest edge}
circumscribed radius rcirc=the distance from the centre to the farthest corner\text{circumscribed radius}\,r_{\text{circ}}=\text{the distance from the centre to the farthest corner}

The robot certainly collides when the obstacle is closer to its centre than rin, and certainly does not when every obstacle is farther than rcirc. Between the two, whether it collides depends on its heading. Costmaps use exactly these two numbers (lesson M2-T2).

A worked example

From odom to map. Scout’s odometry says it is at (2.0, 1.0) m facing 90° in the odom frame. Localization says the odom frame sits at (0.3, −0.2) m, rotated 5° in the map frame. Where is Scout on the map?

Pose composition
θmb=90∘+5∘=95∘\theta _{\text{mb}}=90^{\circ}+5^{\circ}=95^{\circ}
R(5∘)(2.0, 1.0)=(2.0 cos⁡5∘−1.0 sin⁡5∘, 2.0 sin⁡5∘+1.0 cos⁡5∘)R(5^{\circ})(2.0,\,1.0)=(2.0\,\cos 5^{\circ}-1.0\,\sin 5^{\circ},\,2.0\,\sin 5^{\circ}+1.0\,\cos 5^{\circ})
=(1.9924−0.0872, 0.1743+0.9962)=(1.9052, 1.1705)=(1.9924-0.0872,\,0.1743+0.9962)=(1.9052,\,1.1705)
(xmb, ymb)=(0.3, −0.2)+(1.9052, 1.1705)=(2.2052, 0.9705)(x_{\text{mb}},\,y_{\text{mb}})=(0.3,\,-0.2)+(1.9052,\,1.1705)=(2.2052,\,0.9705)

Scout is at (2.205, 0.971) m facing 95° on the map. Now the localization system corrects its estimate and moves the odom frame to (0.8, −0.1). Scout’s odom pose is unchanged, (2.0, 1.0, 90°), but its map pose becomes (2.705, 1.071): a 0.51 m jump. A controller that used the map pose would see 0.51 m of sideways motion in one tick and react violently. A controller that follows the path in the odom frame sees nothing, and the planner simply learns that the goal is now 0.51 m closer or further than it thought.

A footprint corner on the map. The robot’s footprint is 0.6 m × 0.4 m centred on the base. Its front-left corner is at (0.3, 0.2) in the base frame. With the map pose above (2.205, 0.971, 95°), the corner is at R(95°)(0.3, 0.2) + (2.205, 0.971) = (−0.225, 0.281) + (2.205, 0.971) = (1.980, 1.252). The radii are rin = 0.2 m and rcirc = √(0.3² + 0.2²) = 0.361 m.

A cart changes the footprint. If Scout tows a cart so that the body now extends from 0.8 m behind the centre to 0.3 m in front (width still 0.4 m), rin is still 0.2 m but rcirc is √(0.8² + 0.2²) = 0.825 m, more than twice as large. A planner using the old footprint would route the cart through gaps it cannot clear.

Engineering implications and limitations

Timestamps are part of a pose

A pose is valid at a time. Transforming a scan taken 200 ms ago with today’s pose smears obstacles when the robot is moving. Keep timestamps on every message and look transforms up at the time of the data, not the time of use.

Say which frame every number is in

A costmap built in the odom frame and a path in the map frame must be brought into one frame before they are compared. Most stacks do this by transforming the path into the costmap’s frame each cycle. If the transform is stale, the two drift apart without any error message.

One footprint, shared

The footprint belongs in one place, such as the robot’s description, and every planner, costmap and safety monitor should read it from there. Different footprints in different nodes produce a robot that plans through gaps its safety monitor then refuses.

Polygon or circle

A circle is fast, orientation-free and conservative, and is right for round robots. A polygon is tighter for long robots, and needed when a robot should be allowed through a gap lengthwise but not sideways. It costs more to check and makes the heading part of the question (module 4).

Common misconceptions

“The map frame is the truth.”

It is the best estimate of where the robot is on the map, and it can be wrong or jump. It is the right frame for planning because the goal is there, and the wrong frame for smooth control.

“Odom is wrong because it drifts.”

Its drift is slow and its motion is smooth, which is exactly what control needs over a few seconds. The drift is corrected by the map to odom link.

“A circular footprint is always safe.”

A circle that contains the whole body is safe but conservative: a 0.6 m × 0.4 m robot becomes a 0.72 m disc and may be refused a doorway it could pass.

“Frames only matter for the sensors.”

Goals, paths, costmaps and the footprint all live in frames. A mismatch shows up as a robot that drives confidently to the wrong place.

Engineering takeaways

  1. Navigation chains map → odom → base. Localization publishes the first link, odometry the second.
  2. Use the map frame for planning and the odom frame for smooth control, and say which frame every quantity is in.
  3. Poses compose by rotating the child’s position by the parent’s heading and adding the parent’s position.
  4. The footprint is reduced to an inscribed and a circumscribed radius that costmaps use to decide what is certainly blocked.
  5. Timestamp every pose and share one footprint across every component.

References and further reading

The ROS conventions and standard references on pose transformations.

  • ROS Enhancement Proposals REP 103, “Standard Units of Measure and Coordinate Conventions”, and REP 105, “Coordinate Frames for Mobile Platforms”.
  • T. Foote, “tf: The Transform Library”, IEEE Conference on Technologies for Practical Robot Applications, 2013.
  • T. Barfoot, State Estimation for Robotics, Cambridge University Press, 2017.
  • Nav2 documentation, “Setting Up Transformations”, docs.nav2.org.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

Why do navigation systems keep both a map frame and an odom frame, instead of one world frame?

Explanation

Odometry is smooth but drifts, so it suits control; the map frame is globally consistent but can jump when localization corrects it, so it suits planning against a map. Keeping the correction as a separate map to odom link lets each consumer use the frame it needs.

Question 2

A localization update moves the odom frame by 0.4 m. Which of the robot’s poses changes, and what would go wrong if the controller used it?

Explanation

The robot’s pose in the map frame jumps by 0.4 m, while its pose in odom does not change. A controller using the map pose would see a sudden 0.4 m error and issue a large correction, which can make the robot lurch. Using the odom pose avoids this.

Question 3

A robot’s footprint is 1.0 m long and 0.6 m wide, centred on the base. What are its inscribed and circumscribed radii?

Explanation

rin is the distance to the nearest edge, 0.3 m. rcirc is the distance to a corner, √(0.5² + 0.3²) = √0.34 = 0.583 m.

What’s next

Next: turning the robot and its footprint into a single point, which is what configuration space does.

Next lesson

M1-T5 — Configuration Space

Turn a robot with a footprint among obstacles into a point among inflated obstacles, and say when that simplification fails.

Nothing below is required to finish this lesson.