Support for using CONSTANTS as message defaults
Open
@SamuelFoo is already working on this.
Since Apr 27, 2026.
Assessment
This issue has not been assessed yet.
Description
enhancement
help wanted
Description
Currently, constants can be used as follows:
Constants[<=3] constants_values
And defaults:
uint16[<=3] uint16_values_default [0, 1, 65535]
But - when specifying a const default, rosidl fails. I was hoping I could use syntax such as
Constants[<=3] constants_values_default [Constants::CONST_INT8_MAX, Constants::CONST_UINT8_MAX, Constants::CONST_STRING]
or
Constants[<=3] constants_values_default [Constants.CONST_INT8_MAX, Constants.CONST_UINT8_MAX, Constants.CONST_STRING]
I couldn't find any tests for this case
Motivation
above
Design / Implementation Considerations
above
Additional Information
eg
File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/parser.py", line 362, in __init__
self.default_value = parse_value_string(
^^^^^^^^^^^^^^^^^^^
File "/opt/ros/jazzy/lib/python3.12/site-packages/rosidl_adapter/parser.py", line 639, in parse_value_string
raise NotImplementedError(
NotImplementedError: parsing string values into type
- Dominant language
- CMake
- Stars
- 4
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.