-
Notifications
You must be signed in to change notification settings - Fork 240
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
Fix throw in playback of split+compressed bagfiles #294
Conversation
3f494ed
to
ee1756f
Compare
@ros2/aws-oncall - please run this CI job |
Is this a bugfix? If so, can we put in a regression test for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be filing a bug shortly, but here's the current behavior:
ros2 bag play ...
fails for multiple files, but is able to play the first file. This means that the method being changed, load_next_file
, is not being used to load the first file. To simplify the code and improve unit tests, we should be loading all files in the same manner, i.e., one method.
rosbag2_compression/src/rosbag2_compression/sequential_compression_reader.cpp
Outdated
Show resolved
Hide resolved
A proper unit test for this regression will require a |
rosbag2_compression/src/rosbag2_compression/sequential_compression_reader.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Open a ticket to track this please. |
@piraka9011 Opened #297 |
@zmichaels11 what's the status of this PR? Is this waiting on #297 ? |
We want to put sufficient testing on the changes in this PR before merging it in. Edit: |
6c0cc40
to
89d3184
Compare
* Require `compression_mode_` to not be none within `load_next_file` * Require `decompressor_` to not be null if `compression_mode_` is `FILE` in `load_next_file` Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> Fix PR Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
Signed-off-by: Zachary Michaels <zmichaels11@gmail.com> Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
Signed-off-by: Anas Abou Allaban <allabana@amazon.com> Signed-off-by: Anas Abou Allaban <aabouallaban@pm.me>
89d3184
to
3370b91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with green CI.
However, can somebody please elaborate how this is fixing #296? It's not easily visible to me.
The main fix comes from this: if (decompressor_ == nullptr) {
throw std::runtime_error{
"The bag file was not properly opened. "
"Somehow the compression mode was set without opening a decompressor."
};
} Where the previous check was simply: if (decompressor_) {
...
} The previous if statement improperly throws when |
Changes
compression_mode_
to not be none withinload_next_file
decompressor_
to not be null ifcompression_mode_
isFILE
inload_next_file
Closes #296