Skip to content

SetParameter value cannot take a list value, requires special string nesting #499

@emersonknapp

Description

@emersonknapp

Description

Example from YAML:

        - set_parameter:
            name: datum
            # this needs to stay a string through all interpretation to make it to final CLI correctly
            value: '"[$(var navsat_datum_lat), $(var navsat_datum_lon), 0.0]"'

In order to set the value for a parameter of type list<double>, we have to wrap a string explicitly in another string, because from the frontend it goes through two levels of string parsing to typed entities. As only a plain string, it gets turned into a list which fails to render to a CLI arg (only takes strings) for ExecuteProcess.

Motivation

Enable more intuitive usage.

Design / Implementation Considerations

I believe the user should be able to pass typed values directly, if the frontend has types. XML doesn't have this problem, but YAML does.

        - set_parameter:
            name: datum
            value: [$(var navsat_datum_lat), $(var navsat_datum_lon), 0.0]
# or
            value: 
              - $(var navsat_datum_lat)
              - $(var navsat_datum_lon)
              - 0.0

Additional Information

The use case called out here is specific to launch_ros, but may actually be ros2/launch core work to enable

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions