When does rosbag start capturing messages and why I see the delay in two messages?
I am trying to understand how much time it takes for rosbag to start capturing packet as soon as we type rosbag record -a
.
After analyzing packets captured in the wireshark ( see the wireshark packet at https://goo.gl/9kR2WC ) , I found that before receiving any messages from ros nodes, roscord subscribers do several packet negotiations with ROS MASTER and then closes the connection to directly connect with rosnode to receive message from them (In enclosed wireshark capture file, packet no. 91 to 314). I want to know that during this packet negotiation, are ros messages buffered and once connection is established they are recorded or during this packet negotiation are ros messages dropped?
The reason is my bot publishes position and velocity. Differentiating position should give velocity. When I plot differentiated position and velocity, I find that there is lag of 0.4 second in velocity data and time shifting velocity by 0.4 second matches the differentiated position. Please note that positions and velocity data comes from two different sensor(it means they come from two different ros nodes).
My whole point of discussion is to find out the source of the delay or why I need to do time shift in velocity.
Are you using bag timestamps or message timestamps? One of the goals of message timestamps is to provide the source time for a message, so that even if it's received with some delay, the original time-series data can be reconstructed correctly.
I am using MATLAB to read rosbag files http://www.mathworks.com/help/robotic...
I'm not familiar with the matlab bindings for ROS. I suspect you're using the TimerSeries extraction to read messages, but it's not clear if that method of reading the bag file uses the bag timestamps or the timestamps from the message headers.
You may want to try including both the header.stamp and your data when you extract data from the bag, and see how the extracted timestamps compare to the header timestamps.