| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…anager Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com>
|
@roncapat great you started the draft, I will give it a better look ASAP. From a first look I see that it uses a callback with rclcpp::SerializedMessage but the issue is that this would require to receive serialized messages, therefore we miss the IPC requirements. With IPC, smart pointers are passed and no serialization takes place. Thank you for setting up the draft, I will give it a try and have a look as soon as I can. |
Sorry, something went wrong.
|
Hi @mcp-ats , thanks for the feedback! Yes, this patch favours serialization during publishing - before adding the messages to the buffers. Still, this should be partially beneficial. At some point, you will need to serialize anyway. This patch helps serializing just one time even in presence of multiple GenericSubscriber. We may figure out what may be a draft implementation that serializes on the subscription side. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
GenericSubscription is extensively used by rosbag2. However, this means that currently, intra-process communication is not leveraged. Even when composing rosbag2::Recorder, topics are subscribed in the traditional way - IntraProcessManager does not handle the data exchange towards the recorder's subscribers, as the GenericSubscrition does not register itself as capable of intra-process comms (no SubscriptionIntraProcess is created).
Of course, at some point serialization needs to happen. So there will always some cost in using a GenericSubscription. This gets even more valid when dealing with rosbag2, that currently stores data in serialized format. The point here is to avoid RMW / data transmission on loopback when not needed.
This PR allows GenericSubscription to create a SubscriptionIntraProcess whose template type is rclcpp::SerializedMessage. IntraProcessManager gets new internal collections and methods specifically used to track and manage these new subscribers - instead of mixing them in existing structures, they are collected in separate collections so that the added logic can easily treat normal subscribers and generic subscribers in different ways (if needed).
See ros2/rosbag2#2267 for motivation & further context.
Is this user-facing behavior change?
No outstanding changes in API - in theory stuff like rosbag2 needs just to be rebuilt against this branch of rclcpp. Everything happens "under the hood" in the constructor of GenericSubscrition and the IntraProcessManager.
Did you use Generative AI?
No
Additional Information
Feel free to provide your feedbacks on this - I'll may let sink this here for a while before polishing in greater detail.