rosbag2
rosbag2 copied to clipboard
Add simple bag player examples
Fixes #1449.
Added simple bag player examples in cpp and Python. I also tried to read or write bag files without specifying topic types. However, it became too complicated and was no longer a "simple" example, so I decided not to push the changes.
Hi @MichaelOrlov, I think I screwed up with reviewers. Do you mind fixing it and reviewing this PR ?
@sangteak601 @fujitatomoya I am curious how this PR overlaps with the existing tutorial and examples from https://docs.ros.org/en/rolling/Tutorials/Advanced/Reading-From-A-Bag-File-CPP.html ?
@MichaelOrlov
I am curious how this PR overlaps with the existing tutorial and examples from https://docs.ros.org/en/rolling/Tutorials/Advanced/Reading-From-A-Bag-File-CPP.html ?
that is what i found too.
i was thinking that https://docs.ros.org/en/rolling/Tutorials/Advanced/Reading-From-A-Bag-File-CPP.html can also be updated to point the source code from this example.
i was thinking that https://docs.ros.org/en/rolling/Tutorials/Advanced/Reading-From-A-Bag-File-CPP.html can also be updated to point the source code from this example.
I would prefer to make them aligned as much as possible but in the tutorial preferable to have the full text with source code instead of just a link on it.
Also, I think that in the examples still unclear point that if the message always shall be deserialized or not before publishing.
To make it clear and show that it is optional I would suggest adding some class member variable or global variable with name like message_needs_to_be_edit_before_send
and have an if-else
statement showing two options for publishing. With deserialized and altering value before publishing and non-serialized publishing.
cc: @sangteak601
@MichaelOrlov Thanks for the review. I will make a modification.
Based on my knowledge(correct me if I'm wrong), we can also receive serialized messages directly. Therefore, perhaps we can modify the recorder example in a similar manner?
@fujitatomoya @MichaelOrlov I have addressed issues. Do you mind taking another look?
I would prefer to make them aligned as much as possible but in the tutorial preferable to have the full text with source code instead of just a link on it.
i do agree with this. we need to update https://github.com/ros2/ros2_documentation accordingly to align with these samples.
I will update the documentation once this is merged.
- Closing as stale PR in favor of the #1683