# [WARN] [rosbag2_player]: No clock publisher. Clock is not being published while playback is paused.

- **ID:** `ros2/rosbag2-clock-not-published-when-paused`
- **Domain:** ros2
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| ROS2 Humble | active | — | — |
| ROS2 Iron | active | — | — |
| rosbag2 0.15.x | active | — | — |
| rosbag2 0.16.x | active | — | — |

## Workarounds

1. **Avoid pausing playback. Instead, use 'ros2 bag play --rate 0.0' to freeze time, then resume with a positive rate.** (85% success)
   ```
   Avoid pausing playback. Instead, use 'ros2 bag play --rate 0.0' to freeze time, then resume with a positive rate.
   ```
2. **Implement a custom clock bridge node that caches the last /clock message and republishes it when the bag is paused.** (70% success)
   ```
   Implement a custom clock bridge node that caches the last /clock message and republishes it when the bag is paused.
   ```

## Dead Ends

- **** — The bag player controls clock publishing; manual intervention may cause timestamp mismatches or conflicts. (80% fail)
- **** — Pausing is intended; restarting loses playback position and may not fix the underlying issue if nodes need continuous clock. (50% fail)
- **** — This defeats the purpose of using sim_time and may cause nodes to use wall clock, leading to desynchronization. (90% fail)
