ros2 / ros2/rclcpp

subsequent nodes in a namespace in yaml don't get parameters applied

Open
#2,166 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug report

Required Info:

  • Operating System:
    • Ubuntu 22.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • humble
  • DDS implementation:
    • CycloneDDS
  • Client library (if applicable):
    • rclcpp
Steps to reproduce issue

Try a params yaml like this:

namespace:
  node1:
    ros__parameters:
      param: 1.0
  node2:
    ros__parameters:
      param: 2.0
Expected behavior

node1 to have param with a value of 1.0, and node2 to have param with a value of 2.0

Actual behavior

node1 has a param set to 1.0 and node2 has a value of param that is the default. The value from yaml is not applied.

Additional information

Also reported here: https://answers.ros.org/question/394231/ros2-how-to-get-multiple-nodes-under-same-namespace-in-yaml-config-file/

Interestingly, having top level duplicate keys works, even though that is not technically valid yaml, like this:

namespace:
  node1:
    ros__parameters:
      param: 1.0
namespace:
  node2:
    ros__parameters:
      param: 2.0

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.

Research direction

Reproduce the issue in rclcpp with the provided YAML and verify that node1 receives 1.0 while node2 retains its default. Trace the parameter YAML handling and add regression coverage showing that both nodes receive their respective values; done means the second node's parameter is applied correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.