ROS 2 gotcha: use node.get_clock().now(), not time.time(), in simulation

4310sy · x · 2026-09-03

A common robotics pitfall: in ROS 2, don't grab timestamps with Python's time.time() (system clock). Use node.getclock().now() instead.

Simulation nodes may run on a different time axis from the real world, so ROS 2's clock API is required to stay consistent with sim time.

Original post →

More from coding & agent

coding & agent channel →