Skip to content

Add acceptable_buffer_backends field in rmw_subscription_options_s#416

Open
nvcyc wants to merge 1 commit intorollingfrom
native_buffer/7-rmw
Open

Add acceptable_buffer_backends field in rmw_subscription_options_s#416
nvcyc wants to merge 1 commit intorollingfrom
native_buffer/7-rmw

Conversation

@nvcyc
Copy link

@nvcyc nvcyc commented Mar 16, 2026

Description

This pull request adds the acceptable_buffer_backends subscription option in RMW layer. This option allows subscribers to control which buffer backends they accept, with a backward-compatible default of CPU-only.

This pull request consists of the following key changes:

  • rmw (types.h): Adds a new field acceptable_buffer_backends (const char *) on rmw_subscription_options_t. NULL, empty string, or "cpu" means CPU-only (backward-compatible default); "any" means all installed backends; comma-separated names (e.g. "cuda,demo") restrict to those specific backends. rmw_get_default_subscription_options() sets the default to "cpu".

Is this user-facing behavior change?

The default value "cpu" preserves existing behavior -- subscriptions only accept CPU-based data unless explicitly opting in. This is a new API surface but is additive and backward-compatible. Existing code that does not pass acceptable_buffer_backends will behave identically to before.

Did you use Generative AI?

No.

Additional Information

This PR is part of the broader ROS 2 native buffer feature introduced in this post.

Copy link

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM

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