Skip to content

Commit 4674e45

Browse files
authored
Fix ambiguous constructor overload (#499) (#500)
1 parent 7b819ce commit 4674e45

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

control_toolbox/include/control_toolbox/pid_ros.hpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,7 @@ class PidROS
7777
prefix_is_for_params)
7878
{
7979
}
80-
template <class NodeT>
81-
explicit PidROS(std::shared_ptr<NodeT> node_ptr, const std::string & param_prefix)
82-
: PidROS(
83-
node_ptr->get_node_base_interface(), node_ptr->get_node_logging_interface(),
84-
node_ptr->get_node_parameters_interface(), node_ptr->get_node_topics_interface(),
85-
param_prefix, "", false)
86-
{
87-
}
80+
8881
/*!
8982
* \brief Constructor of PidROS class.
9083
*
@@ -93,7 +86,11 @@ class PidROS
9386
*
9487
* \param node Any ROS node
9588
* \param param_prefix prefix to add to the pid parameters.
96-
* \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.
89+
* \param topic_prefix prefix to add to the state publisher.
90+
* If it starts with `~/`, topic will be local under the namespace of the node.
91+
* If it starts with `/` or an alphanumeric character, topic will be in global namespace.
92+
*
93+
* state publisher is not activated if topic_prefix is empty,
9794
*
9895
*/
9996
template <class NodeT>
@@ -103,7 +100,7 @@ class PidROS
103100
: PidROS(
104101
node_ptr->get_node_base_interface(), node_ptr->get_node_logging_interface(),
105102
node_ptr->get_node_parameters_interface(), node_ptr->get_node_topics_interface(),
106-
param_prefix, topic_prefix, true)
103+
param_prefix, topic_prefix, !topic_prefix.empty())
107104
{
108105
}
109106
/*!
@@ -114,7 +111,9 @@ class PidROS
114111
*
115112
* \param node Any ROS node
116113
* \param param_prefix prefix to add to the pid parameters.
117-
* \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.
114+
* \param topic_prefix prefix to add to the state publisher.
115+
* If it starts with `~/`, topic will be local under the namespace of the node.
116+
* If it starts with `/` or an alphanumeric character, topic will be in global namespace.
118117
* \param activate_state_publisher If true, the publisher will be enabled after initialization.
119118
*
120119
*/

0 commit comments

Comments
 (0)