Understand coordinate frames and transforms
Interpret a sensor position without confusing camera, robot, and map coordinates.
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 .
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 1Find 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_linkThese 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.
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.
Before you move on
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