rosbag API C++: Message Header Stamp sec and nsec are always zero?
The "sec" and "nsec" values in the message header are always zero when recording using "rosbag::write". I provide a valid Time for the second parameter, but that only seems to affect the message body timestamp and playback timing, but not the header. Is that expected?
I am converting some odometry and depth image information that was collected in Windows to a rosbag containing tf, depth_image, and camera_info messages (using rosbag API in C++)for consumption by the slam_gmapping node.
The rosbag I create looks correct and it plays back OK (correct timing) but the map is not generated. I looked at the code, and the slam_gmapping node is using a tf::MessageFilter. When I turn on DEBUG messages, I see messages like this "MessageFilter [target=/odom]: Added message in frame camera_depth_frame at time 0.000
". The message queue fills up with messages with time 0.0000
. When I inspect my bag with rqt_bag the header.sec and header.nsec are always zero, so I thought maybe that is the issue.
I have called "rosparam set use_sim_time true", but that does not help. Why is the header stamp always zero, and is that what is causing the tf::MessageFilter to never synch?