-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add non transform capabilities for intra-process (#1849)
That is, make it so that if both a publisher and a subscriber using intra-process and using TypeAdaptation are the same type, we don't need to convert to a ROS Message type on the publisher and from a ROS Message type before delivering to the subscriber. Instead, we store the original message type in the subscription buffer, and deliver it straight through to the subscriber. This has two main benefits: 1. It is better for performance; we are eliding unnecessary work. 2. We can use TypeAdaptation to pass custom handles (like hardware accelerator handles) between a publisher and subscriber. That means we can avoid unnecessary overhead when using a hardware accelerator, like synchronizing between the hardware accelerator and the main CPU. The main way this is accomplished is by causing the SubscriptionIntraProcessBuffer to store messages of the Subscribed Type (which in the case of a ROS message type subscriber is a ROS message type, but in the case of a TypeAdapter type is the custom type). When a publish with a Type Adapted type happens, it delays conversion of the message, and passes the message type from the user down into the IntraProcessManager. The IntraProcessManager checks to see if it can cast the SubscriptionBuffer to the custom type being published first. If it can, then it knows it can deliver the message directly into the SubscriptionBuffer with no conversion necessary. If it can't, it then sees if the SubscriptionBuffer is of a ROS message type. If it is, then it performs the conversion as necessary, and then stores it. In all cases, the Subscription is then triggered underneath so that the message will eventually be delivered by an executor. We also add tests to ensure that in the case where the publisher and subscriber and using the same type adapter, no conversion happens when delivering the message. Signed-off-by: Chris Lalancette <[email protected]> Signed-off-by: Gonzalo de Pedro <[email protected]>
- Loading branch information
1 parent
8093648
commit 6b321ed
Showing
13 changed files
with
1,603 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.