Skip to content

Feature Request: Optional Attributes #850

@Ryanf55

Description

@Ryanf55

DDS supports the optional attribute in IDL 4.2 specification attribute section 8.3.1.3. In C++, now that we have C++17, we can use std::optional.

A prior dicussion is here: https://discourse.ros.org/t/optional-fields-in-message/991/16

Consider adding a @optional specifier to rosidl that translates to the DDS optional .

Amend the ROS 2 design documentation for Standardized Annotations to add optional:
https://design.ros2.org/articles/idl_interface_definition.html

It's supported by:

Workarounds: Bounded array with a max length of 1, but the syntax is funky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions