ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
745 stars 911 forks source link

rosbag "repeat latched" messages are not latched #2350

Open Hugal31 opened 9 months ago

Hugal31 commented 9 months ago

Description

When using rosbag record with splits and --repeat-latched, the latched messages in the subsequent bags are not marked as latched (and also lose the callerId).

This caused issue when I tried to replay a rosbag from the middle using -s.

Steps to reproduce

# Latched topic publisher, in the background
rostopic pub -l /foo std_msgs/Bool true & 
# Non latched topic at 10Hz, so the bags are not empty, in the background
rostopic pub /bar std_msgs/Bool false -r 10 & 

# Record at least 20 seconds
rosbag record /foo /bar -O foo.bag --split --duration 10 --repeat-latched

Kill the rosbag, the two publishers, and try to get /foo from the middle of foo_1.bag:

rostopic echo /foo # In another terminal
rosbag play foo_1.bag -s 5

Expected: the rostopic node displays data: True Actual: nothing happen.