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

Feature Request: Optional Attributes #850

Open
Ryanf55 opened this issue Feb 25, 2025 · 2 comments
Open

Feature Request: Optional Attributes #850

Ryanf55 opened this issue Feb 25, 2025 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Ryanf55
Copy link

Ryanf55 commented Feb 25, 2025

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.

@sloretz sloretz added the enhancement New feature or request label Feb 25, 2025
@alsora alsora added the help wanted Extra attention is needed label Mar 6, 2025
@alsora
Copy link

alsora commented Mar 6, 2025

Hi, we discussed this during the ROS waffle meeting and while we agree that this would be a useful feature, we also recognize that it will require a relatively large amount of work.
It would be great to get some support from the community.

@alsora alsora pinned this issue Mar 6, 2025
@Ryanf55
Copy link
Author

Ryanf55 commented Mar 7, 2025

Thanks. If I end up getting time allocated at work, I'll request being assigned, but otherwise anyone is welcome.

Would you accept a merge with opt-in support of @optional if I got it working only with the following:

  • FastDDS
  • rosidl_generator_cpp

We want this feature to integrate with a non-ROS-based software. The only incompatibility is the use of optional.
Getting this working on all RMW's and all languages is unlikely to be approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants