Skip to content

Allow declaring parameters with uninitialized values #1649

@jacobperron

Description

@jacobperron

Feature request

Feature description

There are situations where we want to declare a parameter, but not initialize it until later.

For example, it would be nice to declare a parameter, with a type like this without it throwing an exception because the user did not provide an override at runtime:

node->declare_parameter(name, type);

We could then later set the value of the parameter programmatically from the node itself (e.g. with set_parameter) or let the user set it later with a service call (e.g. ros2 param set).

Implementation considerations

After declaring a parameter without an initial value and if there is no user-provided override, then I would expect the parameter to have a value of "UNSET", and trying to access a value might throw an exception.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions