Skip to content

ROS_DISABLE_LOAN_MSG flag to disable LoanedMessage from rmw #945

@fujitatomoya

Description

@fujitatomoya

we'd like to open discussion, any comments are welcome.

Feature request

Feature description

adding environmental flag to disable LoanedMessage in rcl even if rmw implementation supports it. this is ROS general way to do that is agnostic from rmw implementation.
once user set environmental variable ROS_DISABLE_LOAN_MSG=1 in the process space, LoanedMessage is disable gracefully. this allows user to disable LoanedMessage and fallback to normal publisher / subscription w/o any code change or rmw implementation specific configuration.

Implementation considerations

since this is ROS general switch to the middleware, rcl would be the best place to support.
rcl_publisher_can_loan_messages and rcl_subscription_can_loan_messages checks environmental variable ROS_DISABLE_LOAN_MSG and return false immediately. this can conceal implementation feature for any frontend library such as rclcpp.

(just idea) thinking about LoanedMessage as rmw feature, we could have ROS_DISABLE_FEATURE_FLAG=0xBEEF which bit fields map to the specific feature to disable. so that we can avoid having redundant flag in the future.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions