Skip to content

Commit

Permalink
Fix for getParam name resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
john-maidbot committed May 11, 2024
1 parent f21b98e commit 5e8a7e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ class SimplePublisherPlugin : public point_cloud_transport::PublisherPlugin
bool getParam(const std::string & name, T & value) const
{
if (simple_impl_) {
return simple_impl_->node_->get_parameter(name, value);
uint ns_len = simple_impl_->node_->get_effective_namespace().length();
std::string param_base_name = getTopic().substr(ns_len);
std::replace(param_base_name.begin(), param_base_name.end(), '/', '.');

std::string param_name = param_base_name + "." + name;

return simple_impl_->node_->get_parameter(param_name, value);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ class SimpleSubscriberPlugin : public SubscriberPlugin
bool getParam(const std::string & name, T & value) const
{
if (impl_) {
return impl_->node_->get_parameter(name, value);
uint ns_len = impl_->node_->get_effective_namespace().length();
std::string param_base_name = getTopic().substr(ns_len);
std::replace(param_base_name.begin(), param_base_name.end(), '/', '.');

std::string param_name = param_base_name + "." + name;

return impl_->node_->get_parameter(param_name, value);
}
return false;
}
Expand Down

0 comments on commit 5e8a7e6

Please sign in to comment.