ros2 / ros2/rclcpp

Odd parameter overrides' ordering when using wildcards

Open
#953 20 comments 1 reaction 1 assignee View on GitHub

@ivanpauno is already working on this.

Since Jun 26, 2020.

bug
Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • Binaries
  • Version or commit hash:
    • Eloquent (mostly 0.8.1)
  • Client library (if applicable):
    • rclcpp
Steps to reproduce issue
  1. Write a parameter YAML file, explicit_params.yaml, setting use_sim_time explicitly referring to a node:

    talker:
        ros__parameters:
            use_sim_time: false    
    
  2. Write a parameter YAML file, wildcard_params.yaml, setting use_sim_time implicitly using wildcards:

    /**:
        ros__parameters:
            use_sim_time: true    
    
  3. Run a talker node:

    • Passing the parameter YAML file using wildcards first:

      ros2 run demo_nodes_cpp talker --ros-args --params-file path/to/wildcard_params.yaml --params-file path/to/explicit_params.yaml
      
    • Passing the parameter YAML file being explicit first:

      ros2 run demo_nodes_cpp talker --ros-args --params-file path/to/explicit_params.yaml --params-file path/to/wildcard_params.yaml
      
Expected behavior

I'm not sure if we've ever fully specified behavior when using wildcards.

  • If wildcards have lower precedence than fully qualified names, command line order should not matter i.e. use_sim_time always false.

  • If command line order is respected, use_sim_time should be false in the first case, true in the second case.

Actual behavior

First given override wins.

Additional information

This is inconsistent with how it works for rclpy nodes, where command line order is respected. Looking at both rclpy and rclcpp implementations, it looks behavior emerged by pure chance. We should probably be matching wildcards where we can enforce a consistent precedence, down in rcl.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.