Understand coordinate frames and transforms

Interpret a sensor position without confusing camera, robot, and map coordinates.

Exercise brief·Beginner·3 min read

Opening the Python editor…

Requirements and learning goals

Before you start

  • The learn-go2 simulator from lesson 1, with advancing /odom timestamps

You will be able to

  • Interpret a sensor position without confusing camera, robot, and map coordinates.

The browser exercise above works without extra setup. The project brief below assumes the listed prerequisites and gives you a task and checks to perform. Need a guided first project?

Why a position needs a frame

“One meter ahead” depends on where you stand and which way you face. A defines an origin and axes. A transform describes the translation and rotation between two frames. 's tf2 system lets programs combine those relationships at a particular time.

This matters when a camera sees an object and a robot must reach it. Camera coordinates cannot be used directly as a destination on a map.

Common frames are base_link, attached to the robot; odom, a continuous local reference that can drift; and map, a global reference corrected by .

Rendering diagram…
The conventional chain of frames. Each arrow is a transform: a translation and rotation that can change over time.
Checkpoint 1 of 2

You want to store a goal position that stays valid while the robot drives around for a long time. Which frame should it be expressed in?

Commit to an answer. Every choice explains itself.

Transforms still use standard tf2 messages and frame conventions. The CLI forwards inspection commands; it does not redefine your frame tree.

The camera-to-world lessons put these transforms to work: a detection becomes a location only after camera geometry and frame alignment are known.

Inspect the relationships

If joining here, complete the shared Go2 setup. Choose learn-go2 in the Simulator tab whenever the device picker opens. List its and read one transform.

wendy device ros2 topics
wendy device ros2 echo /tf --count 1

Find a transform's header.frame_id, child_frame_id, translation, and rotation. One message may contain only part of the frame tree. Fixed sensor mounts usually appear on /tf_static.

For a combined lookup, forward a ROS command to the device:

wendy device ros2 exec run tf2_ros tf2_echo base_link lidar_link

These frame names belong to the shared Go2. Expect a fixed mount translation and rotation; stop with Ctrl+C. The inspection environment needs tf2_ros. If the package is missing, check the simulator/CLI versions against the setup guide. Other robots can use different frame names.

Work through one point

Suppose the sensor is mounted 0.2 m forward and 0.3 m above the base, with identical axis orientation. Its origin is [0.2, 0, 0.3] in the base frame. An object at [1, 0, 0] in that sensor frame is [1.2, 0, 0.3] in the base frame.

That addition only works without rotation. Camera optical frames normally use different axes, so use the full transform for real detections.

Checkpoint 2 of 2

A robot's origin is at [2, 1] in the map. It is rotated 90 degrees, so its forward x axis points along map +y. A point lies at [1, 0] in the robot frame. Where is it in the map?

Commit to an answer. Every choice explains itself.

Check your result

Compare the reported sensor offset with the model or physical mounting. A missing transform means the chain is incomplete; an extrapolation error usually means the requested time is outside available data. Use the observation's timestamp for moving transforms.

Continue to services and actions.

Can you do each of these?

  • Interpret a sensor position without confusing camera, robot, and map coordinates.

0 of 2 checkpoints solved. Try checkpoint 1

Previous: ROS 2 nodes, topics, and QoS
All lessons in this topic
  1. 1. ROS 2 nodes, topics, and QoS
  2. 2. Understand coordinate frames and transforms
  3. 3. Choose services, actions, and behavior states
  4. 4. Estimate motion and compare it with commands
  5. 5. Separate mapping, localization, and navigation

Ask Wendy

Answers about Wendy and WendyOS

What would you like to know?

Ask about devices, development, and deployment.

Check linked docs for technical details.