Skip to content

Commit

Permalink
Naming BT client node after action name (#2470)
Browse files Browse the repository at this point in the history
* Put action name in node namespace instead of node name

* Put namespace remapping in node options

* Rename client node with action name replacing "/" by "_"

* Code formatting

* Code formatting
  • Loading branch information
anaelle-sw authored Jul 26, 2021
1 parent 61670a1 commit 0356413
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,16 @@ bool BtActionServer<ActionT>::on_configure()
throw std::runtime_error{"Failed to lock node"};
}

// use suffix '_rclcpp_node' to keep parameter file consistency #1773
// Name client node after action name
std::string client_node_name = action_name_;
std::replace(client_node_name.begin(), client_node_name.end(), '/', '_');
// Use suffix '_rclcpp_node' to keep parameter file consistency #1773
auto options = rclcpp::NodeOptions().arguments(
{"--ros-args",
"-r", std::string("__node:=") + std::string(node->get_name()) + action_name_ + "_rclcpp_node",
"-r",
std::string("__node:=") + std::string(node->get_name()) + client_node_name + "_rclcpp_node",
"--"});

// Support for handling the topic-based goal pose from rviz
client_node_ = std::make_shared<rclcpp::Node>("_", options);

Expand Down

0 comments on commit 0356413

Please sign in to comment.