Skip to content

Conversation

@ipa-rwu
Copy link
Member

@ipa-rwu ipa-rwu commented Oct 2, 2025

@ipa-nhg
Hi Nadia, I fixed the issue about using namespace in rossystem. The current tooling will use the node name to create node in launch file which will override the node with the same node name but different namespace. There is also same issue to create parameter file.
For example, a rossystem (the following example) defines 2 instance nodes from the same node but with different namespaces.

mock_system:
  nodes:
    lifecycle_manager: # responsible to start all the managed nodes above
      from: "nav2_lifecycle_manager.lifecycle_manager"
      namespace: test
      parameters:
        - autostart: "lifecycle_manager::autostart" # Whether to transition nodes to active state on startup.
          value: true
        - node_names: "lifecycle_manager::node_names" # Ordered list of node names to bringup through lifecycle transition.
          value: ['bt_operator',
          'entry_sensor/check_pll_not_present',
          'escaper_sensor/check_pll_not_present',
          ]
        - bond_timeout: "lifecycle_manager::bond_timeout" # Heartbeat timeout. Timeout to transition down all lifecycle nodes of this manager if a server is non-responsive, in seconds. Set to 0 to deactivate. Recommended to be always larger than 0.3s for all-local node discovery. Note: if a server cleanly exits the manager will immediately be notified.
          value: 0.0
    # entry_sensor
    check_pll_not_present:
      from: "signal_process_skill.wait_signal_until_true_timeout_action_server"
      namespace: entry_sensor
      interfaces:
        - 'wait_signal_false_timeout': as-> "wait_signal_until_true_timeout_action_server::check_signal_reach_desired_bool"
        - '/bond': pub-> "wait_signal_until_true_timeout_action_server::bond"
    # escaper_sensor
    check_pll_not_present:
      from: "signal_process_skill.wait_signal_until_true_timeout_action_server"
      namespace: escaper_sensor
      interfaces:
        - 'wait_signal_false_timeout': as-> "wait_signal_until_true_timeout_action_server::check_signal_reach_desired_bool"
        - '/bond': pub-> "wait_signal_until_true_timeout_action_server::bond"
  • parameter file: It will generate parameter file in config folder as "namespace"_"node_name"
  • Launch file: it will create a node as "namespace"_"node_name", e.g.
       entry_sensor_check_pll_not_present = Node(
     package="signal_process_skill",
     namespace="entry_sensor",
     executable="wait_signal_until_true_timeout_action_server",
     output='screen',
     name="check_pll_not_present"
    )
    escaper_sensor_check_pll_not_present = Node(
     package="signal_process_skill",
     namespace="escaper_sensor",
     executable="wait_signal_until_true_timeout_action_server",
     output='screen',
     name="check_pll_not_present"
    )

More details about changes:
This pull request introduces improvements to the naming and handling of ROS 2 nodes and their parameters, especially in the context of namespaces, across the codebase. The main focus is to ensure that node names in launch files and documentation are unique and descriptive when namespaces are used, and to standardize parameter handling. The changes also add a helper function for string manipulation and address minor documentation and parameter reference issues.

Launch file and node naming improvements:

  • Node variable names in generated launch files now include the namespace (with the leading slash removed) as a prefix when a namespace is present, ensuring uniqueness and clarity. This change is reflected in both the launch file compiler and the README documentation. [1] [2] [3]
  • The generated YAML configuration files are now named with the namespace as a prefix if the node has a namespace, improving organization and avoiding filename collisions.

Parameter handling and references:

  • Parameter references in launch commands and documentation are now explicitly cast to RosParameter, ensuring type safety and consistency. [1] [2] [3]
  • In YAML configuration generation, parameter names are now taken from the referenced source parameter (param.from.name) rather than the local name, which improves accuracy when parameters are shared or aliased.

Utilities and minor fixes:

  • Added a removeLeadingSlash helper function to standardize namespace string formatting by removing a leading slash if present.
  • Fixed a minor typo in the README instructions for installing dependencies.

@ipa-rwu ipa-rwu changed the title Fix: use namespace when creating paramter and node in launch file Fix: Node got override in launch file and parameter files when using namespace in rossystem Oct 2, 2025
@ipa-rwu ipa-rwu force-pushed the rwu/fix/namespace branch 2 times, most recently from d8f5eb4 to bd899d6 Compare October 6, 2025 09:07
@ipa-nhg
Copy link
Member

ipa-nhg commented Oct 22, 2025

@ipa-rwu Many thanks for the fixes and the great documentation. Could you please rebase the branch to the ipa320 origin? The commits related to the new Java SE 21 version have already been merged, shouldn't appear here.
Thanks!

@ipa-rwu
Copy link
Member Author

ipa-rwu commented Oct 22, 2025

@ipa-rwu Many thanks for the fixes and the great documentation. Could you please rebase the branch to the ipa320 origin? The commits related to the new Java SE 21 version have already been merged, shouldn't appear here. Thanks!

Done!

@ipa-nhg ipa-nhg merged commit 11b1d0e into ipa320:main Oct 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants