ros2 / ros2/launch

argument collision in included files (xml and yaml)

Open
#815 7 comments 1 reaction 1 assignee View on GitHub

@mjcarroll is already working on this.

Since Feb 27, 2025.

Dominant language
Python
Stars
155
Forks
182
Avg merge
2d 14h
Merged PRs (30d)
6

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • humble
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • N/A
Steps to reproduce issue

test.yaml

   launch:
       - include:
             file: "$(find-pkg-share my_package)/launch/inc1.yaml"
       - include: 
             file: "$(find-pkg-share my_package)/launch/inc2.yaml"

inc1.yaml

   launch:
       - arg: {name: "my_parameter", default: "my_parameter_value_1"}
       - executable:
             cmd: "echo inc1 $(var my_parameter)"
             output: "screen"

inc2.yaml

   launch:
       - arg: {name: "my_parameter", default: "my_parameter_value_2"}
       - executable:
             cmd: "echo inc2 $(var my_parameter)"
             output: "screen"

Output:

   [INFO] [echo-1]: process started with pid [86076]
   [INFO] [echo-1]: process has finished cleanly [pid 86076]
   [INFO] [echo-2]: process started with pid [86078]
   [echo-1] inc1 my_parameter_value_1
   [INFO] [echo-2]: process has finished cleanly [pid 86078]
   [echo-2] inc2 my_parameter_value_1
Actual behavior

Default value of my_parameter in inc2 is overrided by default value of parameter with the same name in inc1

Expected behavior

Parameters in separate files should not collide.

Additional information

The issue can be avoided by additionally scoping each include with group, however, I strongly believe that scoping should be implied by inclusion.

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.