ros2 runtime_error ai_generated partial

[警告] [rosbag2_player]: 没有时钟发布者。播放暂停时不会发布时钟。

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

ID: ros2/rosbag2-clock-not-published-when-paused

其他格式: JSON · Markdown 中文 · English
80%修复率
87%置信度
1证据数
2023-09-10首次发现

版本兼容性

版本状态引入弃用备注
ROS2 Humble active
ROS2 Iron active
rosbag2 0.15.x active
rosbag2 0.16.x active

根因分析

当 ros2 bag play 暂停时(例如通过空格键),/clock 主题停止发布,导致依赖 sim_time 的节点挂起或失败。

English

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

官方文档

https://docs.ros.org/en/rolling/Tutorials/Beginner-CLI-Tools/Recording-And-Playing-Back-Data/Recording-And-Playing-Back-Data.html

解决方案

  1. 避免暂停播放。相反,使用 'ros2 bag play --rate 0.0' 冻结时间,然后以正速率恢复。
  2. 实现一个自定义时钟桥接节点,缓存最后一个 /clock 消息,并在包暂停时重新发布它。

无效尝试

常见但无效的做法:

  1. 80% 失败

    The bag player controls clock publishing; manual intervention may cause timestamp mismatches or conflicts.

  2. 50% 失败

    Pausing is intended; restarting loses playback position and may not fix the underlying issue if nodes need continuous clock.

  3. 90% 失败

    This defeats the purpose of using sim_time and may cause nodes to use wall clock, leading to desynchronization.