Fixed so that only the node name is needed in a params.yaml file. Before the fully qualified name was required.

node_name:
  ros__parameters:
    p1: ["a", "aa"]

The following also works:
/node_name:
/**:
**:
This commit is contained in:
Kristofer Bengtsson 2020-07-08 09:11:26 +02:00
parent 5260d3ba8e
commit 8a80f26e6e
1 changed files with 8 additions and 2 deletions

View File

@ -562,7 +562,8 @@ impl Node {
(*(*params.as_ref())).params, (*(*params.as_ref())).num_nodes) (*(*params.as_ref())).params, (*(*params.as_ref())).num_nodes)
}; };
let qualified_name = self.fully_qualified_name()?; let qualified_name = self.fully_qualified_name()?;
let name = self.name()?;
for (nn, np) in node_names.iter().zip(node_params) { for (nn, np) in node_names.iter().zip(node_params) {
let node_name_cstr = unsafe { CStr::from_ptr(*nn as *mut i8) }; let node_name_cstr = unsafe { CStr::from_ptr(*nn as *mut i8) };
@ -571,7 +572,12 @@ impl Node {
// This is copied from rclcpp, but there is a comment there suggesting // This is copied from rclcpp, but there is a comment there suggesting
// that more wildcards will be added in the future. Take note and mimic // that more wildcards will be added in the future. Take note and mimic
// their behavior. // their behavior.
if !(node_name == "/**" || qualified_name == node_name) { if !(
node_name == "/**" ||
node_name == "**" ||
qualified_name == node_name ||
name == node_name
) {
continue; continue;
} }