From 36c42b38d90eb9d5e4d80952a2fd3624cbecb711 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 14:14:27 +0100 Subject: [PATCH] Add controller name parameter (backport #212) (#215) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Alejandro Hernández Cordero Co-authored-by: Jakub Delicat <109142865+delihus@users.noreply.github.com> Co-authored-by: Alejandro Hernández Cordero --- gz_ros2_control/src/gz_ros2_control_plugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gz_ros2_control/src/gz_ros2_control_plugin.cpp b/gz_ros2_control/src/gz_ros2_control_plugin.cpp index ab9aacaf..a97d859a 100644 --- a/gz_ros2_control/src/gz_ros2_control_plugin.cpp +++ b/gz_ros2_control/src/gz_ros2_control_plugin.cpp @@ -297,6 +297,11 @@ void GazeboSimROS2ControlPlugin::Configure( // Get controller manager node name std::string controllerManagerNodeName{"controller_manager"}; + + if (sdfPtr->HasElement("controller_manager_name")) { + controllerManagerNodeName = sdfPtr->GetElement("controller_manager_name")->Get(); + } + std::string ns = "/"; if (sdfPtr->HasElement("ros")) {