Fix: Node got override in launch file and parameter files when using namespace in rossystem #224
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@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.
"namespace"_"node_name""namespace"_"node_name", e.g.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:
Parameter handling and references:
RosParameter, ensuring type safety and consistency. [1] [2] [3]param.from.name) rather than the local name, which improves accuracy when parameters are shared or aliased.Utilities and minor fixes:
removeLeadingSlashhelper function to standardize namespace string formatting by removing a leading slash if present.