ros2
runtime_error
ai_generated
partial
[WARN] [rosbag2_player]: No clock publisher. Clock is not being published while playback is paused.
ID: ros2/rosbag2-clock-not-published-when-paused
80%Fix Rate
87%Confidence
1Evidence
2023-09-10First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| ROS2 Humble | active | — | — | — |
| ROS2 Iron | active | — | — | — |
| rosbag2 0.15.x | active | — | — | — |
| rosbag2 0.16.x | active | — | — | — |
Root Cause
When ros2 bag play is paused (e.g., via spacebar), the /clock topic stops publishing, causing nodes relying on sim_time to hang or fail.
generic中文
当 ros2 bag play 暂停时(例如通过空格键),/clock 主题停止发布,导致依赖 sim_time 的节点挂起或失败。
Official Documentation
https://docs.ros.org/en/rolling/Tutorials/Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data.htmlWorkarounds
-
85% success Avoid pausing playback. Instead, use 'ros2 bag play --rate 0.0' to freeze time, then resume with a positive rate.
Avoid pausing playback. Instead, use 'ros2 bag play --rate 0.0' to freeze time, then resume with a positive rate.
-
70% success Implement a custom clock bridge node that caches the last /clock message and republishes it when the bag is paused.
Implement a custom clock bridge node that caches the last /clock message and republishes it when the bag is paused.
中文步骤
避免暂停播放。相反,使用 'ros2 bag play --rate 0.0' 冻结时间,然后以正速率恢复。
实现一个自定义时钟桥接节点,缓存最后一个 /clock 消息,并在包暂停时重新发布它。
Dead Ends
Common approaches that don't work:
-
80% fail
The bag player controls clock publishing; manual intervention may cause timestamp mismatches or conflicts.
-
50% fail
Pausing is intended; restarting loses playback position and may not fix the underlying issue if nodes need continuous clock.
-
90% fail
This defeats the purpose of using sim_time and may cause nodes to use wall clock, leading to desynchronization.