Rosbag record does not record the first messages

768 Views Asked by At

I am having a problem with ROS rosbag. I have a python script that generates and publishes messages. I try to record them with rosbag record but the generated rosbag does not seem to contain the first messages.

I have done the following:

  1. Run the script while in other terminal I have rostopic echo /the_message and I can see that all messages are being correctly generated --> so it is not a problem of the script

  2. Run first (just in case some "initialization time" is needed) in one terminal rosbag record -O data.bag /the_message and then in other terminal the script. I got the bag file correctly. But then when playing the bag with rosbag play --clock data.bag and rostopic echo /the_message in other terminal I got only the messages from the third or fourth message. Never the first message

What could be happening? and How can I ensure the recording takes place including the first messages?

0

There are 0 best solutions below