rosbag2 icon indicating copy to clipboard operation
rosbag2 copied to clipboard

Add simple bag player examples

Open sangteak601 opened this issue 11 months ago • 7 comments

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.

sangteak601 avatar Mar 06 '24 06:03 sangteak601

Hi @MichaelOrlov, I think I screwed up with reviewers. Do you mind fixing it and reviewing this PR ?

sangteak601 avatar Mar 06 '24 20:03 sangteak601

@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 avatar Mar 15 '24 06:03 MichaelOrlov

@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.

fujitatomoya avatar Mar 15 '24 16:03 fujitatomoya

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 avatar Mar 15 '24 16:03 MichaelOrlov

@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?

sangteak601 avatar Mar 16 '24 15:03 sangteak601

@fujitatomoya @MichaelOrlov I have addressed issues. Do you mind taking another look?

sangteak601 avatar Mar 22 '24 19:03 sangteak601

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.

sangteak601 avatar Apr 01 '24 20:04 sangteak601

  • Closing as stale PR in favor of the #1683

MichaelOrlov avatar Jun 26 '24 18:06 MichaelOrlov