rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

Duration in metadata.yaml is wrong when bag is split by time and size (humble)

Open andrewbest-tri opened this issue 11 months ago • 7 comments

Description

When recording a bag in humble, I expect the metadata.yaml duration field to be equal to last_message_timestamp - first_message_timestamp. However, it is set to whatever the split duration is when splitting by time, and some function of the split duration when splitting by size.

Expected Behavior

Record a bag for 30 seconds split at 5 second intervals. Metadata.yaml duration is 30 * 1e9

command I use ros2 bag record -a -d 5 -b 86016

Actual Behavior

Record a bag for 30 seconds with ros2 bag record -a -d 5 -b 86016

Inspect metadata.yaml. Duration is 5 * 1e9, the length of the split.

To Reproduce

** Steps to reproduce the behavior, e.g.

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. Logs print error '...' **

Terminal 1:

ros2 topic pub /foobar std_msgs/msg/Empty "{}"

Terminal 2:

ros2 bag record -a -d 5 -b 86016

wait 30 seconds. stop the bag. inspect.

System (please complete the following information)

  • OS: Ubuntu Jammy
  • ROS 2 Distro: Humble
  • Version: Latest from APT

Additional context

We use a backport to foxy which shows this behavior in rosbag2, but that isn't a surprise as its the same codebase.

andrewbest-tri avatar Jul 10 '23 19:07 andrewbest-tri