Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data sharing is required to enable loaned interface on subscription. #726

Closed
wants to merge 1 commit into from

Conversation

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Comment on lines -565 to +568
subscription->can_loan_messages = info->type_support_->is_plain();
bool has_data_sharing = DataSharingKind::OFF != qos.data_sharing().kind();
subscription->can_loan_messages = has_data_sharing && info->type_support_->is_plain();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally did not apply the same change to the publisher, since that is clear that user need to use LoanedMessage class explicitly, and it also provide performance improvement for intra and UDP transport w/o data sharing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this misses the point that you may want to use messages loaned from the middleware even when you're not doing inter-process zero-copy (so called "DataSharing" with Fast-DDS).

You would also like to use loaned messages to avoid copies, which is why the rclcpp executor uses it by default.

Copy link
Member

@wjwwood wjwwood Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: you may want your subscription to use messages loaned from the middleware

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah that was original intention to enable loaned message w/o DataSharing in Fast-DDS. It still provides the performance improvement for subscription, after ros2/rcl#1110 is merged, probably we do not need this one.

@fujitatomoya
Copy link
Collaborator Author

I will go ahead to close this one, see ros-navigation/navigation2#3863 (comment) for more details.

and,

will do the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants