Skip to content

Commit 6ae1df6

Browse files
authored
Fix the node name overlapping in the Hardware Components (#3006)
1 parent 5667d80 commit 6ae1df6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hardware_interface/src/hardware_component_interface.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ CallbackReturn HardwareComponentInterface::init(
124124
{
125125
std::string node_name = hardware_interface::to_lower_case(params.hardware_info.name);
126126
std::replace(node_name.begin(), node_name.end(), '/', '_');
127-
impl_->hardware_component_node_ = std::make_shared<rclcpp::Node>(
128-
node_name, params.node_namespace, define_custom_node_options());
127+
128+
auto options = define_custom_node_options();
129+
options.arguments({"--ros-args", "-r", "__node:=" + node_name});
130+
131+
impl_->hardware_component_node_ =
132+
std::make_shared<rclcpp::Node>(node_name, params.node_namespace, options);
129133
locked_executor->add_node(impl_->hardware_component_node_->get_node_base_interface());
130134
}
131135
else

0 commit comments

Comments
 (0)