-
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
use rclcpp serialized messages to write data #457
Conversation
Maybe I'm missing some context - now that rclcpp::SerializedMessage exists (and if we pull a dependency on rclcpp) - do we still need the rosbag2 SerializedBagMessage structure? Or do they provide the same functionality |
fair point. I am a big fan of making the serialized bag message a POD, essentially removing the shared pointer and only having the actual buffer pointer. We could get around rclcpp if the rosbag2 api only introduces API which takes a serialized data buffer ( |
oh, also to be clear. The |
Makes sense. I think it's fine to add the |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-2-tsc-meeting-minutes-2020-07-16/15468/1 |
@Karsten1987 did this already get implemented in a different PR? Any need to keep this draft open? |
b9c68db
to
0e34ea2
Compare
@emersonknapp please have a look at this. I've just finished the reader and writer API in conjunction with the |
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.
This LGTM - it is a clean interface
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Signed-off-by: Karsten Knese <Karsten1987@users.noreply.github.com>
Co-authored-by: Emerson Knapp <537409+emersonknapp@users.noreply.github.com>
0316275
to
04ee864
Compare
04ee864
to
3af5a0f
Compare
Next on the list towards a user-friendly C++ API. Sits on top of "defaults" branch.The implementation here is pretty straightforward even though we have to iterate over the existing data structures used here at some point, namely the
rosbag2_storage::SerializedBagMessage
. We're dealing with shared pointers here in order to ease the cleanup of the underlyinguint8
buffer. However, this prevents any stack allocations and makes it pretty cumbersome to integrate with the existingrclcpp::SerializedMessage
API.As a second point, I personally don't see a way around the
rclcpp
dependency at this point. Even though I'd like to keep the number of dependencies here fairly small, in order to eventually come up with atemplate<class MsgT> void write(MsgT & msg)
API, we'd need to have that dependency.I'll open this PR as a draft to start a discussion.