Practice the ROS2 Transform Listener coding problem in TF2 Listening. Browser-based execution with automated grading — no local ROS install required. 72% of engineers pass this challenge.
Implement a ROS2 node that reads the coordinate transform between two frames from the TF2 tree and logs the result.
Your node must:
tf2_ros.Buffer and a tf2_ros.TransformListener attached to itcreate_timer(1.0, ...) to periodically look up the transform from 'base_link' to 'map'self.tf_buffer.lookup_transform('map', 'base_link', rclpy.time.Time()) to get the latest available transformLookupException, ConnectivityException, ExtrapolationExceptionself.get_logger().info()Input: Transforms published on /tf and /tf_static (consumed automatically by TransformListener)
Output: Periodic log lines showing translation and rotation from base_link → map
Every Nav2 planner, every perception pipeline, and every arm controller reads TF2. When you call lookup_transform('map', 'base_link', Time()) you get the robot's current position in the world frame — the same call that Nav2's costmap, the move_base equivalent, and RViz2 all make internally hundreds of times per second.
TransformListener(self.tf_buffer, self) — the second argument is the node, which provides the clock and executor context. Miss it and the buffer never gets populated.rclpy.time.Time() vs a specific stamp: Time() means "latest available". Passing a specific stamp requires that transform to exist in the buffer at exactly that time — usually not what you want.LookupException will crash your node on startup when frames haven't been published yet.It is a hands-on TF2 Listening challenge on SimuCode where you implement and run ROS2 code in the browser with runtime-verified tests.
Open this page, sign in, and solve the problem in the built-in IDE. Your solution is graded against real ROS2 execution checks.
This Medium problem focuses on tf2, listener, lookup skills used in robotics interviews and production systems.