Additional improvements to TypeAdapted intra-process comms
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 805
- Forks
- 564
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 27
Description
When we merged in https://github.com/ros2/rclcpp/pull/1849 , we did it knowing that there were still improvements that could be made to the code. In particular, there are 2 outstanding issues with that code that we know about:
- There is a TODO in the code at https://github.com/ros2/rclcpp/blob/6b321edb4fabcc57f666f77a4dc091e95948070b/rclcpp/include/rclcpp/publisher.hpp#L333-L343 . In particular, if we are calling
do_intra_process_publish, then it may be the case that as part of that call we are doing a conversion from PublishType -> ROSMessageType so that we can store the ROSMessageType in one or more of the subscribers. But if we did that indo_intra_process_publish, we are unnecessarily doing it again in thepublishcall directly. The answer is probably to make a new overload ofdo_intra_process_publish_and_return_sharedwhich always returns the ROSMessageType, and then use that directly when doing the inter-process publish. This probably requires plumbing all the way down to theIntraProcessManagerlayer. - There's a discussion in https://github.com/ros2/rclcpp/pull/1849#discussion_r780489707 about simplifying the number of cases we need to handle in
AnySubscriptionCallback. Currently we allow the signature of the Subscription callback to be a different (though convertible) type from the template type we passed tocreate_subscription. However, if we force the two of them to be the same, then we can get rid of several case statements when dispatching data. That would help a lot in maintenance since there are a lot of cases handled during dispatch currently.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in rclcpp/include/rclcpp/publisher.hpp at the referenced TODO, then trace do_intra_process_publish through the IntraProcessManager layer. Review AnySubscriptionCallback and the discussion on pull request 1849 before deciding how the two callback and publish paths should be simplified. Done means both identified conversion and callback-dispatch improvements are implemented consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- distributed-systems
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100