Robotics From Zero
Module: Where Am I

Coordinate Frames

Learn what coordinate frames are, why every sensor and part has its own frame, and how frames let robots understand 'where' things are.

10 min read

Coordinate Frames

Orange industrial robot arms on an automotive assembly line — each arm joint defines its own coordinate frame
Industrial robot arms on an assembly line. Every joint in these arms defines its own coordinate frame — understanding how frames relate to each other is what lets these robots position themselves with millimeter precision.

A robot arm picks up a coffee mug. Simple, right? But here's the question: where is the mug?

The answer depends on who's asking. To the camera, the mug is "30cm forward, 5cm left." To the gripper, it's "10cm away, straight ahead." To the robot's base, it's "somewhere over there." Same mug, three different answers.

This is the problem of coordinate frames — and it's the foundation of all robot perception, manipulation, and navigation.

What Is a Coordinate Frame?

A coordinate frame (also called a reference frame) is a way to describe positions and orientations in 3D space. Think of it as an invisible ruler attached to something.

Every frame has:

  1. An origin point — the (0, 0, 0) location
  2. Three axes — X (red), Y (green), Z (blue) pointing in specific directions
  3. A name — like "world", "base_link", "camera", "left_gripper"
Note

The standard robotics convention is X = forward, Y = left, Z = up. This is called the "right-hand rule" — point your right hand's fingers in the X direction (forward), curl them toward Y (left), and your thumb points up (Z).

Right-hand rule for coordinate frame orientation — index finger is X, middle finger is Y, thumb is Z
The right-hand rule: point your index finger along X (forward), curl your middle finger toward Y (left), and your thumb naturally points along Z (up).

Why Frames Matter

Imagine a robot with:

  • A camera on its head
  • A gripper on its arm
  • Wheels on its base
Robot base coordinate frame with X, Y, Z axes labeled
A coordinate frame attached to a robot's base — the origin sits at the center, with X forward, Y left, Z up.

Each of these has a natural frame:

ComponentFrameOriginPurpose
WorldworldA fixed point on the floorThe "map" — everything is ultimately measured relative to this
Robot basebase_linkCenter of the robot's bodyRobot-centric measurements
Cameracamera_opticalCamera lens centerWhere pixels "see" things
Gripperleft_gripperGripper fingersWhere the gripper "thinks" objects are

When the camera detects an object at position (0.5, 0.2, 0.1) in its frame, that's different from the same coordinates in the gripper's frame or the world frame. We need to transform between frames.

Multiple coordinate frames on one robot — base_link, camera_link, and gripper_link each with their own axes
A single robot has many coordinate frames — each sensor and actuator defines its own local reference.

World vs Body Frames

There are two major categories:

1. World Frame (Global/Fixed)

  • Fixed in space, never moves
  • Usually anchored to the floor or a starting point
  • Used for navigation, mapping, multi-robot coordination
  • Example: "The charging station is at (5, 3, 0) in the world frame"
World frame vs robot frame — the same point has different coordinates in each frame
The same object has different coordinates depending on which frame you measure from.

2. Body Frames (Local/Moving)

  • Attached to parts of the robot
  • Move as the robot moves
  • Used for sensor measurements, arm control, collision detection
  • Example: "The camera sees the mug at (0.3, 0.1, 0.2) in the camera frame"
Tip

A common beginner mistake: assuming all measurements are in the world frame. In reality, sensors always measure in their own frame. Your job as a robotics engineer is to transform these measurements into the frame where they're useful.

An Example: Coffee Mug Pickup

Let's say:

  • Camera (on the robot's head) sees a mug at (0.5, 0.1, 0.3) in camera frame
  • The robot's head is rotated 30° left from the base
  • The robot wants to move its gripper to pick up the mug

Here's what needs to happen:

  1. Transform mug position from camera frame → head frame
  2. Transform from head frame → base frame (accounting for the 30° rotation)
  3. Transform from base frame → gripper frame
  4. Command the gripper: "move to this position"

Without frames and transforms, this would be impossible. You'd have to manually compute angles and offsets every time the robot moves. Frames make it automatic.

Frames Are Everywhere

Every robot system has dozens (sometimes hundreds) of frames:

This is called a transform tree (we'll cover this in detail in Lesson 3). Each arrow represents a parent-child relationship.

Frame hierarchy tree — world to base_link to arm and camera chains
Frames form a tree hierarchy — each frame has one parent, and transforms chain from root to leaf.

What's Next?

Now that you know what frames are and why they exist, the next lesson will show you how to transform between them — the math of rotation and translation that makes multi-frame robotics work.

Got questions? Join the community

Discuss this lesson, get help, and connect with other learners on r/softwarerobotics.

Join r/softwarerobotics

Frequently Asked Questions

What is a coordinate frame in robotics?

A coordinate frame is a reference system with an origin point and three axes (X, Y, Z) used to describe positions and orientations. Robots use multiple frames — one for the body (base_link), one for the world (map), and one for each sensor. Transforms relate these frames to each other.

What is the difference between the map frame and the odom frame?

The map frame is a global, drift-free reference tied to the environment. The odom frame is a local frame that tracks the robot's motion continuously but accumulates drift over time. Localization algorithms compute the correction between odom and map.

Why does robotics use radians instead of degrees?

Radians are the natural unit for angular measurement in mathematics and physics. Trigonometric functions, angular velocity (rad/s), and rotational dynamics all use radians natively. Using radians avoids constant conversion and reduces bugs in robotics code.

Further Reading

Related Lessons

Discussion

Sign in to join the discussion.