ROS 2 ROSInterruptException: rate.sleep() after rclpy.shutdown()
rate.sleep() wakes about 1 ms after rclpy.shutdown() and raises ROSInterruptException; Ctrl+C gives KeyboardInterrupt, so catch both and call try_shutdown().
rate.sleep() wakes about 1 ms after rclpy.shutdown() and raises ROSInterruptException; Ctrl+C gives KeyboardInterrupt, so catch both and call try_shutdown().
await asyncio.sleep() in an rclpy callback raises 'no running event loop'. await call_async() hung on a SingleThreadedExecutor until the callback was in a ReentrantCallbackGroup. For real asyncio, run rclpy.spin in a thread. Measured on Humble and Jazzy.
ros2 bag convert with storage_id: mcap works once Humble has ros-humble-rosbag2-storage-mcap; delete the empty output folder a failed run leaves. Jazzy bags fail in Humble with yaml-cpp bad conversion until you play the .mcap with a QoS override.
rclpy now() is 0 until the first /clock, so now() - Duration fails even if Gazebo starts at 100 s; skip when now.nanoseconds <= window.nanoseconds.
apt update clears the ROS 2 404 only when it actually downloads a new package list: look for Get, not Hit or an error, then recount the Failed to fetch lines.
Use ExecuteProcess; the bag starts only when the recorder subscribes, so you lose more than Hz × timer delay, and with --use-sim-time everything before /clock.
For No module named 'rclpy', source the setup file matching your shell in that terminal; for _rclpy_pybind11, use the system python3, not conda's.
Your copy of the same ROS key expired. Install ros2-apt-source and delete the old ros2.list and keyring, or apt stops on a Signed-By conflict.
Launch joins substitution lists as strings, so '2' and '5' become '25' (int 25 as a node parameter); add with PythonExpression([a, ' + ', b]) instead.
Keep Gazebo real_time_factor at or below sensor period / worst-case processing time: a node taking up to 0.25 s on a 16 Hz camera needs 0.25.
ROS 2 troubleshooting guide · How these articles are made