Skip to content

Allow non-ros parameters in params file #1149

@davy-code

Description

@davy-code

Feature request

Feature description

Allow non-ROS parameters to be disregarded by the YAML parser when running a node with --ros-args --params-file <config-name>.yaml
Currently a node e.g. turtlesim crashes with a YAML file looking like this:

/turtlesim:
  ros__parameters:
    background_b: 3
  other__parameters:
    param_1: 1

With the error:
Error: Cannot have a value before ros__parameters at line 5, at ./src/parse.c:793, at ./src/rcl/arguments.c:406
The parsing of the YAML file prevents easy integration in larger deployments where ros2 is only one of several middlewares being used. This implementation also prevents having one YAML file in larger deployments where a ros2 node is perhaps only a small part of the larger software stack.

Implementation considerations

  1. Allow a certain YAML key which will be ignored by the ROS2 YAML parser. Easy to implement but is more difficult for larger (non-ROS centric) software stacks.
  2. Disregard the full YAML apart from parameters specified if the key is ros__parameters. Might create uglier (less ROS-like) YAML files but allows for easy integration in larger software stacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions