-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add additional examples for reading ROSBag data and serialized messages #1449
Comments
This one covers reading: Unfortunately, if the topic name is the wrong topic type than what is attempted to deserialize to, then there is a crash. |
IMO we could have This seems |
Yea. The existing tutorial can be improved to make sure the new code prevents exceptions thrown in RMW by trying to deserialize the wrong message type and making assumptions about what's in the bag. ANYbotics/grid_map#401 |
I want to take a look at this. |
@sangteak601 Thank you for being willing to help with this. You have got it 😉 |
Description
Currently, the ROSBag2 examples contain three different examples for writing data to a ROSBag via C++ or Python. However, there are no specific examples of reading data from ROSBags (neither for the standard reader or the sequential reader). In addition, the writing examples do not show how to serialize various messages before writing them to a bag file.
Inside the file under rosbag2_tests/test/rosbag2_tests/test_rosbag2_cpp_api.cpp, there are test cases for reading data and also for the message serialization. These helped me when using the ROSBag2 API, but in my opinion, a better idea is to create dedicated examples, because the unit tests should be meant solely for testing.
Completion Criteria
rosbag2_cpp::Reader
)rosbag2_cpp::SequentialReader
)rclcpp::SerializedMessage
andrclcpp::Serialization<>
)The text was updated successfully, but these errors were encountered: