-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duration in metadata.yaml is wrong when bag is split by time and size (humble) #1413
Comments
Thanks for the report - this does indeed sound like incorrect behavior. If you have a fix with regression test, PRs are welcome, otherwise this will go on the backlog for when somebody can get to it. |
I disagree, the fact that no messages were recorded since beginning and until the end of recording is valuable and a bag should contain that information independent of whether split or not. |
Maybe my example wasn't clear. There are two terminals. Every single split in the bag has messages but the duration metadata is still wrong. Does that clarify @chaoflow . I also don't think I understand. What is your expected behavior if the bag is empty? Duration 0? That makes sense to me but isn't what's happening here. |
@andrewbest-tri I think that the start and end time should reflect the start and end of a recording, not the first and last message:
Duration = end time - start time |
I tend to agree with @chaoflow for the sake of consistency. On the rolling, we have implemented saving metadata inside bag for each file for SQLite3 and perhaps after #1423 will be accepted and merged we will have the same for MCAP. It will help to have the ability to store correct start and stop times for each bag after the split. |
Could this be backported to humble? |
@l-schilling See my closing notes at the #1473 |
|
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.
Terminal 1:
Terminal 2:
wait 30 seconds. stop the bag. inspect.
System (please complete the following information)
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.
The text was updated successfully, but these errors were encountered: