ros2 / ros2/rclcpp

Additional improvements to TypeAdapted intra-process comms

Open
#1,860 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
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:

  1. 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 in do_intra_process_publish, we are unnecessarily doing it again in the publish call directly. The answer is probably to make a new overload of do_intra_process_publish_and_return_shared which always returns the ROSMessageType, and then use that directly when doing the inter-process publish. This probably requires plumbing all the way down to the IntraProcessManager layer.
  2. 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 to create_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.