Skip to content
Snippets Groups Projects
Commit de195c44 authored by Alejandro Lopez Gestoso's avatar Alejandro Lopez Gestoso
Browse files

get_goal_tolerance -> get_goal_tolerances

parent 8f76512b
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ class CTEBLPModule : public CNavPlannerModule<ModuleCfg>
*
* \return The status of the operation.
*/
dyn_reconf_status_t get_goal_tolerance(double &xy_tol, double &yaw_tol);
dyn_reconf_status_t get_goal_tolerances(double &xy_tol, double &yaw_tol);
/**
* \brief Function to set the both goal tolerances parameters.
......@@ -75,7 +75,7 @@ class CTEBLPModule : public CNavPlannerModule<ModuleCfg>
*
* \return The status of the operation.
*/
dyn_reconf_status_t set_goal_tolerance(double &xy_tol, double &yaw_tol);
dyn_reconf_status_t set_goal_tolerances(double &xy_tol, double &yaw_tol);
/**
* \brief Function to set the parameter
......@@ -205,7 +205,7 @@ class CTEBLPModule : public CNavPlannerModule<ModuleCfg>
}
template <class ModuleCfg>
dyn_reconf_status_t CTEBLPModule<ModuleCfg>::set_goal_tolerance(double &xy_tol, double &yaw_tol)
dyn_reconf_status_t CTEBLPModule<ModuleCfg>::set_goal_tolerances(double &xy_tol, double &yaw_tol)
{
this->planner_reconf.set_parameter("xy_goal_tolerance",xy_tol);
if(this->planner_reconf.get_status()==DYN_RECONF_SUCCESSFULL)
......@@ -214,7 +214,7 @@ class CTEBLPModule : public CNavPlannerModule<ModuleCfg>
}
template <class ModuleCfg>
dyn_reconf_status_t CTEBLPModule<ModuleCfg>::get_goal_tolerance(double &xy_tol, double &yaw_tol)
dyn_reconf_status_t CTEBLPModule<ModuleCfg>::get_goal_tolerances(double &xy_tol, double &yaw_tol)
{
if(this->planner_reconf.get_parameter("xy_goal_tolerance",xy_tol))
{
......
......@@ -44,8 +44,8 @@ class CTEBLPModuleBT
// conditions
// actions
BT::NodeStatus set_goal_tolerance(BT::TreeNode& self);
BT::NodeStatus get_goal_tolerance(BT::TreeNode& self);
BT::NodeStatus set_goal_tolerances(BT::TreeNode& self);
BT::NodeStatus get_goal_tolerances(BT::TreeNode& self);
BT::NodeStatus set_xy_goal_tolerance(BT::TreeNode& self);
BT::NodeStatus get_xy_goal_tolerance(BT::TreeNode& self);
BT::NodeStatus set_yaw_goal_tolerance(BT::TreeNode& self);
......@@ -86,8 +86,8 @@ class CTEBLPModuleBT
// Registration of conditions
//Registration of actions
factory.registerSimpleAction(this->name+"teb_set_goal_tolerance", std::bind(&CTEBLPModuleBT::set_goal_tolerance, this, std::placeholders::_1), set_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_get_goal_tolerance", std::bind(&CTEBLPModuleBT::get_goal_tolerance, this, std::placeholders::_1), get_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_set_goal_tolerances", std::bind(&CTEBLPModuleBT::set_goal_tolerances, this, std::placeholders::_1), set_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_get_goal_tolerances", std::bind(&CTEBLPModuleBT::get_goal_tolerances, this, std::placeholders::_1), get_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_set_xy_goal_tolerance", std::bind(&CTEBLPModuleBT::set_xy_goal_tolerance, this, std::placeholders::_1), set_xy_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_get_xy_goal_tolerance", std::bind(&CTEBLPModuleBT::get_xy_goal_tolerance, this, std::placeholders::_1), get_xy_goal_tol_ports);
factory.registerSimpleAction(this->name+"teb_set_yaw_goal_tolerance", std::bind(&CTEBLPModuleBT::set_yaw_goal_tolerance, this, std::placeholders::_1), set_yaw_goal_tol_ports);
......@@ -108,32 +108,32 @@ class CTEBLPModuleBT
}
template <class ModuleCfg>
BT::NodeStatus CTEBLPModuleBT<ModuleCfg>::set_goal_tolerance(BT::TreeNode& self)
BT::NodeStatus CTEBLPModuleBT<ModuleCfg>::set_goal_tolerances(BT::TreeNode& self)
{
ROS_DEBUG("CTEBLPModuleBT::set_goal_tolerance-> set_goal_tolerance");
ROS_DEBUG("CTEBLPModuleBT::set_goal_tolerances-> set_goal_tolerances");
BT::Optional<double> bt_xy = self.getInput<double>("xy_tolerance");
BT::Optional<double> bt_yaw = self.getInput<double>("yaw_tolerance");
if (!bt_xy || !bt_yaw)
{
ROS_ERROR("CTEBLPModuleBT::set_goal_tolerance-> Incorrect or missing input. It needs the following input ports: xy_tolerance(double) yaw_tolerance(double)");
ROS_ERROR("CTEBLPModuleBT::set_goal_tolerances-> Incorrect or missing input. It needs the following input ports: xy_tolerance(double) yaw_tolerance(double)");
return BT::NodeStatus::FAILURE;
}
double xy=bt_xy.value();
double yaw=bt_yaw.value();
if(this->module.set_goal_tolerance(xy,yaw)==DYN_RECONF_SUCCESSFULL)
if(this->module.set_goal_tolerances(xy,yaw)==DYN_RECONF_SUCCESSFULL)
return BT::NodeStatus::SUCCESS;
else
return BT::NodeStatus::FAILURE;
}
template <class ModuleCfg>
BT::NodeStatus CTEBLPModuleBT<ModuleCfg>::get_goal_tolerance(BT::TreeNode& self)
BT::NodeStatus CTEBLPModuleBT<ModuleCfg>::get_goal_tolerances(BT::TreeNode& self)
{
ROS_DEBUG("CTEBLPModuleBT::get_goal_tolerance-> get_goal_tolerance");
ROS_DEBUG("CTEBLPModuleBT::get_goal_tolerances-> get_goal_tolerances");
double xy,yaw;
if(this->module.get_goal_tolerance(xy,yaw)==DYN_RECONF_SUCCESSFULL)
if(this->module.get_goal_tolerances(xy,yaw)==DYN_RECONF_SUCCESSFULL)
{
self.setOutput("xy_tolerance", xy);
self.setOutput("yaw_tolerance", yaw);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment