From 4d19b13d74a3ca26027bf0220ee0f89a4efb5e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Sun, 5 Oct 2025 08:40:03 +0200 Subject: [PATCH] Fix ambiguous constructor overload (#499) (cherry picked from commit d84f3fa2959324d7f61d0e546ce2c32b7d246f95) # Conflicts: # control_toolbox/include/control_toolbox/pid_ros.hpp --- .../include/control_toolbox/pid_ros.hpp | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/control_toolbox/include/control_toolbox/pid_ros.hpp b/control_toolbox/include/control_toolbox/pid_ros.hpp index b8106946..bfb7ffa2 100644 --- a/control_toolbox/include/control_toolbox/pid_ros.hpp +++ b/control_toolbox/include/control_toolbox/pid_ros.hpp @@ -77,14 +77,7 @@ class PidROS prefix_is_for_params) { } - template - explicit PidROS(std::shared_ptr node_ptr, const std::string & param_prefix) - : PidROS( - node_ptr->get_node_base_interface(), node_ptr->get_node_logging_interface(), - node_ptr->get_node_parameters_interface(), node_ptr->get_node_topics_interface(), - param_prefix, "", false) - { - } + /*! * \brief Constructor of PidROS class. * @@ -93,7 +86,11 @@ class PidROS * * \param node Any ROS node * \param param_prefix prefix to add to the pid parameters. - * \param topic_prefix prefix to add to the state publisher. If it starts with `~/`, topic will be local under the namespace of the node. If it starts with `/` or an alphanumeric character, topic will be in global namespace. + * \param topic_prefix prefix to add to the state publisher. + * If it starts with `~/`, topic will be local under the namespace of the node. + * If it starts with `/` or an alphanumeric character, topic will be in global namespace. + * + * state publisher is not activated if topic_prefix is empty, * */ template @@ -103,7 +100,7 @@ class PidROS : PidROS( node_ptr->get_node_base_interface(), node_ptr->get_node_logging_interface(), node_ptr->get_node_parameters_interface(), node_ptr->get_node_topics_interface(), - param_prefix, topic_prefix, true) + param_prefix, topic_prefix, !topic_prefix.empty()) { } /*! @@ -114,7 +111,9 @@ class PidROS * * \param node Any ROS node * \param param_prefix prefix to add to the pid parameters. - * \param topic_prefix prefix to add to the state publisher. If it starts with `~/`, topic will be local under the namespace of the node. If it starts with `/` or an alphanumeric character, topic will be in global namespace. + * \param topic_prefix prefix to add to the state publisher. + * If it starts with `~/`, topic will be local under the namespace of the node. + * If it starts with `/` or an alphanumeric character, topic will be in global namespace. * \param activate_state_publisher If true, the publisher will be enabled after initialization. * */