rclcpp
rclcpp copied to clipboard
Dnae adas/generic subscriber and publisher
using SerializedMessage and support in intraprocess manager to create a generic subscriber / publisher without previously known message type
@Karsten1987 I did not create a spezialzation of Publisher for SerializedMessages as I disklike copying so much redudant code. I redesigned it so the changes to the Publisher are reduced. I hope it does not break to much with the current api. (But I have also a version with a spezialized publisher in backup)
depends on #1076
A few questions before reviewing, I'm probably missing some context from https://github.com/ros2/rclcpp/pull/973 discussion:
- what's the goal of the "generic" publisher/subscription?
- how they differ from
Publisher
/Subscription
?
Thanks!
A few questions before reviewing, I'm probably missing some context from #973 discussion:
* what's the goal of the "generic" publisher/subscription? * how they differ from `Publisher`/`Subscription`?
Thanks!
The "generic" publisher/subscriber allows communication without knowing the message type to compile time. Therefore a serialized message can bei published or received and the endpoint has to handle the content itself. This is used for example in rosbag2.
This implementation supports now intraprocess communication when using the C++ version of serialized messages which make the memory handling more safe.
The "generic" publisher/subscriber allows communication without knowing the message type to compile time. Therefore a serialized message can bei published or received and the endpoint has to handle the content itself. This is used for example in rosbag2.
Ah ok. So in those cases, you use MessageT=SerializedMessageBase
, and you don't need to know the message type at compile time, right?
Switching back to create_generic_... would solve this. Do you have another suggestion?
@Karsten1987 I lost a little bit the track of the conversation. What's the current status?
In my opinion, https://github.com/ros2/rclcpp/pull/1076#discussion_r413487908 this is where we stand. I think the intraprocess manager should be sorted out before pushing forward with this change.
Thanks @DensoADAS for iterating over this PR.
Unfortunately, we've passed API freeze for Foxy and after talking with @jacobperron (the Foxy lead), we've decided to table this for G-Turtle.
Is a generic subscriber available in Foxy? I don't think I can use ROS2 until it is in. :/
Is a generic subscriber available in Foxy?
Not in rclcpp. Unless something like this PR can be done in an ABI compatible way, I don't think we can expect it to land in Foxy.
As mentioned on ROS Answers, you can do this in Python and/or copy the C++ implementation from rosbag2 for your application.