Atlas Robotics
Math for RoboticsBasic

Robot coordinate systems: why one robot needs multiple frames

Atlasbot · 17/8/2026 · 10 min read

Robot coordinate systems: why one robot needs multiple frames
The four most common coordinate systems in a mobile robot

A LiDAR point detected at coordinates (2, 0.5) — but 2 meters in which direction, from where? This question only makes sense when associated with a specific coordinate frame. Real robots don't use a single coordinate system — they always need at least 3-4 different systems, each of which answers one question correctly.

Key concepts

Four common coordinate systems in mobile robots:

  • base_link — attached to the robot body, the coordinate origin is usually located at the center of the robot, the x axis points forward. The coordinates of a hard-mounted sensor on the robot are always fixed in this system — unchanged no matter where the robot moves
  • odom — "local" coordinate system, origin is located at the robot position at startup, continuously updated according to odometry. Smooth, high frequency updates, but drifts over time due to accumulated errors
  • map — "absolute" coordinate system relative to a known map, periodically calibrated using SLAM/AMCL to eliminate drift errors of odom. Not as smooth as odom but more accurate in the long term
  • sensor_frame (e.g. lidar_link, camera_link) — mounted at the exact physical location of each sensor

In short: The question "what are these coordinates?" must always be accompanied by the second question "relative to what coordinate system?" — ignoring the second part is the source of most robot "running in the wrong position" errors even though the calculation formula is completely correct.

How it works

Each system serves a different need, with a trade-off between "smoothness" and "long-term accuracy":

base_link → fixed compared to the robot, used to know where the sensor is mounted
odom → smooth, high frequency, used for instantaneous control — but gradual
map → long-term accuracy, used for global path planning — slower updates

If you only use map for everything, the robot will "jerk" every time the AMCL recalibrates its position. If you only use odom, the position will drift indefinitely over time. Separating the two systems allows each controller to use the right type of data for the frequency/accuracy it needs.

Knowing the coordinates of a point in one system, wanting to know the corresponding coordinates in another system — requires a transform operation to connect the two systems. A series of successive transformations forms TF tree — each coordinate system is a node, each edge connecting two nodes is a transform.

Technical details

Parameters

The coordinate axis orientation standard that ROS2 uniformly regulates (REP-103) — following this standard helps all packages (Nav2, SLAM, sensor drivers) "understand each other" without having to manually convert:

ShaftConventional direction
xFace the robot forward
yFace the robot left
zHead up
Distance unitMeter (m)
Angular unitRadian (rad)

This is the right-handed coordinate system — the right-hand rule determines the positive direction of rotation around each axis.

Practical applications

When operating multiple AMR robots in the same area (fleet), each robot has its own odom system (the origin is located at that robot's location at startup) — the odom system of robot A has absolutely no meaning to robot B. In order for the robots to know each other's relative positions (avoid collisions, coordinate tasks), a system is needed. coordinates map (or a higher level common world system) that all robots refer to — this is why the fleet management system always needs a calibration step (localization) to bring the estimated position of each robot to the same common coordinate system before comparing or coordinating between robots.

Practical example

import numpy as np

# The robot is at position (2, 1) in the map system, rotated 90 degrees relative to the map system
robot_x, robot_y, robot_theta = 2, 1, np.radians(90)

# A LiDAR point measured 1m ahead of the robot, in the base_link system
point_local = np.array([1, 0])

# Rotate in the robot's direction and then translate according to the robot's position — switch to the map system
R = np.array([[np.cos(robot_theta), -np.sin(robot_theta)],
              [np.sin(robot_theta),  np.cos(robot_theta)]])
point_map = R @ point_local + np.array([robot_x, robot_y])

print(f"Diem trong he map: ({point_map[0]:.2f}, {point_map[1]:.2f})")
Output:
Diem trong he map: (2.00, 2.00)

The point "1m in front of the robot" in system base_link becomes (2, 2) in system map — because the robot is rotating 90° (looking at the y axis of the map system), "in front of the robot" corresponds to "+y in the map system", plus the robot's home position (2, 1) gives this result.

Common mistakes

  • Using coordinates without specifying which system you are in — directly adding/comparing coordinates from 2 different systems (eg: target position in system map with robot position in system odom) without transforming first — very common error and difficult to detect because the code still runs, only giving wrong results.
  • Consider odom to be absolutely accurate over a long period of time — drift error accumulates gradually, after a few minutes of continuous movement, it can vary by tens of centimeters to several meters depending on the encoder/IMU quality — only map (calibrated with SLAM/AMCL) is reliable for long-term decisions.
  • Third-party sensor drivers use different axis conventions REP-103 — some original cameras/IMUs use z-forward (lens direction) instead of x-forward according to ROS standard — integration without proper conversion causes silent data distortion, data is "correct in number" but has wrong geometric meaning.
  • Believe in frame_id written in the message without actually transforming — ROS2 messages always have a frame_id field declaring which system it belongs to, but just reading this label does not automatically convert coordinates — still have to call tf2 to look up and apply the actual transform before using coordinates in another system.

Conclusion

A robot needs multiple coordinate systems at the same time because each system makes different trade-offs between smoothness and long-term accuracy — base_link for relatively fixed position, odom for instantaneous control, map for global decision. Always clearly define the coordinate system before working on any coordinate numbers. The next article in this section is about Rotation — a more detailed representation of rotation than the 2D rotation matrix seen in the Matrix article, expanded to 3D space.

Get new articles and lessons by email

When a new technical article or course module is published, Atlas Robotics sends you a short email. No spam.

Unsubscribe any time with the link in each email. See our Privacy policy.

Robot coordinate systems: why one robot needs multiple frames — Atlas Robotics