Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 9 additions & 25 deletions control_toolbox/include/control_toolbox/pid_ros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,6 @@ namespace control_toolbox
class PidROS
{
public:
/*!
* \brief Constructor of PidROS class.
*
* The node is passed to this class to handler the ROS parameters, this class allows
* to add a prefix to the pid parameters
*
* \param node ROS node
* \param prefix prefix to add to the pid parameters.
* Per default is prefix interpreted as prefix for topics.
* \param prefix_is_for_params provided prefix should be interpreted as prefix for parameters.
* If the parameter is `true` then "/" in the middle of the string will not be replaced
* with "." for parameters prefix. "/" or "~/" at the beginning will be removed.
*
*/
template <class NodeT>
explicit PidROS(std::shared_ptr<NodeT> 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.
*
Expand All @@ -83,7 +61,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 <class NodeT>
Expand All @@ -93,7 +75,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())
{
}

Expand All @@ -105,7 +87,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.
*
*/
Expand Down