-
Notifications
You must be signed in to change notification settings - Fork 185
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Feature request
Feature description
Currently, the only way to pass node parameters over the command line is via a YAML file. To improve usability, we'd like to be be able to pass key value pairs directly, as ROS1 rosrun does. Grounds for this have to be established here and then leveraged in downstream client libraries (e.g. rclpy and rclcpp).
As a proposal for a syntax and since ROS1 syntax e.g. _name:=value would be parsed as a ROS2 remapping rule, we could make use of a dotted '.' equivalent .name:=value (credits to @sloretz for it). For a usage example, consider:
ros2 run demo_nodes_cpp talker \
.bool_param:=true \
.int_param:=1 \
.float_param:=1.2 \
.str_param:='...' \
.bool_array_param:="[true, false, true]" \
.int_array_param:="[1, 2, 3]" \
.float_array_param:="[1.0, 2.0, 3.0]" \
.str_array_param:="['a', 'b', 'c']" \
.nested.int_param:=0 \
.nested:="{str_param: '...'}"which would roughly equate to the following YAML file:
bool_param: true
int_param: 1
float_param: 1.2
str_param: '...'
bool_array_param: [true, false, true]
int_array_param: [1, 2, 3]
float_array_param: [1.0, 2.0, 3.0]
str_array_param: ['a', 'b', 'c']
nested:
int_param: 0
str_param: '...'Implementation considerations
As a likely prerequisite, #246 has to be implemented first.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request