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

Fixed missname in get/set_restart_dist

parent 9aee2ec5
No related branches found
No related tags found
No related merge requests found
......@@ -143,14 +143,14 @@ class CFollowLPModule : public CNavPlannerModule<ModuleCfg>
}
template <class ModuleCfg>
dyn_reconf_status_t CFollowLPModule<ModuleCfg>::get_follow_restart_dist(double &value)
dyn_reconf_status_t CFollowLPModule<ModuleCfg>::set_follow_restart_dist(double &value)
{
this->planner_reconf.set_parameter("follow_restart_dist",value);
return this->planner_reconf.get_status();
}
template <class ModuleCfg>
dyn_reconf_status_t CFollowLPModule<ModuleCfg>::set_follow_restart_dist(double &value)
dyn_reconf_status_t CFollowLPModule<ModuleCfg>::get_follow_restart_dist(double &value)
{
if(this->planner_reconf.get_parameter("follow_restart_dist",value))
return DYN_RECONF_SUCCESSFULL;
......
......@@ -48,8 +48,8 @@ class CFollowLPModuleBT
BT::NodeStatus get_update_dist(BT::TreeNode& self);
BT::NodeStatus set_follow_dist(BT::TreeNode& self);
BT::NodeStatus get_follow_dist(BT::TreeNode& self);
BT::NodeStatus get_follow_restart_dist(BT::TreeNode& self);
BT::NodeStatus set_follow_restart_dist(BT::TreeNode& self);
BT::NodeStatus get_follow_restart_dist(BT::TreeNode& self);
BT::NodeStatus set_spline_dist_samples(BT::TreeNode& self);
BT::NodeStatus get_spline_dist_samples(BT::TreeNode& self);
};
......@@ -69,8 +69,8 @@ class CFollowLPModuleBT
BT::PortsList get_update_dist_ports = {BT::OutputPort<double>("update_dist")};
BT::PortsList set_follow_dist_ports = {BT::InputPort<double>("follow_dist")};
BT::PortsList get_follow_dist_ports = {BT::OutputPort<double>("follow_dist")};
BT::PortsList get_follow_restart_dist_ports = {BT::InputPort<double>("follow_restart_dist")};
BT::PortsList set_follow_restart_dist_ports = {BT::OutputPort<double>("follow_restart_dist")};
BT::PortsList set_follow_restart_dist_ports = {BT::InputPort<double>("follow_restart_dist")};
BT::PortsList get_follow_restart_dist_ports = {BT::OutputPort<double>("follow_restart_dist")};
BT::PortsList set_spline_dist_samples_ports = {BT::InputPort<int>("spline_dist_samples")};
BT::PortsList get_spline_dist_samples_ports = {BT::OutputPort<int>("spline_dist_samples")};
......@@ -82,8 +82,8 @@ class CFollowLPModuleBT
factory.registerSimpleAction(this->name+"_follow_get_update_dist", std::bind(&CFollowLPModuleBT::get_update_dist, this, std::placeholders::_1), get_update_dist_ports);
factory.registerSimpleAction(this->name+"_follow_set_follow_dist", std::bind(&CFollowLPModuleBT::set_follow_dist, this, std::placeholders::_1), set_follow_dist_ports);
factory.registerSimpleAction(this->name+"_follow_get_follow_dist", std::bind(&CFollowLPModuleBT::get_follow_dist, this, std::placeholders::_1), get_follow_dist_ports);
factory.registerSimpleAction(this->name+"_follow_get_follow_restart_dist", std::bind(&CFollowLPModuleBT::get_follow_restart_dist, this, std::placeholders::_1), get_follow_restart_dist_ports);
factory.registerSimpleAction(this->name+"_follow_set_follow_restart_dist", std::bind(&CFollowLPModuleBT::set_follow_restart_dist, this, std::placeholders::_1), set_follow_restart_dist_ports);
factory.registerSimpleAction(this->name+"_follow_get_follow_restart_dist", std::bind(&CFollowLPModuleBT::get_follow_restart_dist, this, std::placeholders::_1), get_follow_restart_dist_ports);
factory.registerSimpleAction(this->name+"_follow_set_spline_dist_samples", std::bind(&CFollowLPModuleBT::set_spline_dist_samples, this, std::placeholders::_1), set_spline_dist_samples_ports);
factory.registerSimpleAction(this->name+"_follow_get_spline_dist_samples", std::bind(&CFollowLPModuleBT::get_spline_dist_samples, this, std::placeholders::_1), get_spline_dist_samples_ports);
}
......@@ -109,7 +109,10 @@ class CFollowLPModuleBT
if(this->module.set_update_dist(update_dist)==DYN_RECONF_SUCCESSFULL)
return BT::NodeStatus::SUCCESS;
else
{
ROS_ERROR("CFollowLPModuleBT::set_update_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
template <class ModuleCfg>
......@@ -126,6 +129,7 @@ class CFollowLPModuleBT
else
{ //Just beacuse in case of error to put something on the output port
self.setOutput("update_dist", update_dist);
ROS_ERROR("CFollowLPModuleBT::get_update_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
......@@ -145,7 +149,10 @@ class CFollowLPModuleBT
if(this->module.set_follow_dist(follow_dist)==DYN_RECONF_SUCCESSFULL)
return BT::NodeStatus::SUCCESS;
else
{
ROS_ERROR("CFollowLPModuleBT::set_follow_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
template <class ModuleCfg>
......@@ -162,35 +169,39 @@ class CFollowLPModuleBT
else
{ //Just beacuse in case of error to put something on the output port
self.setOutput("follow_dist", follow_dist);
ROS_ERROR("CFollowLPModuleBT::get_follow_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
template <class ModuleCfg>
BT::NodeStatus CFollowLPModuleBT<ModuleCfg>::get_follow_restart_dist(BT::TreeNode& self)
BT::NodeStatus CFollowLPModuleBT<ModuleCfg>::set_follow_restart_dist(BT::TreeNode& self)
{
ROS_DEBUG("CFollowLPModuleBT::get_follow_restart_dist-> get_follow_restart_dist");
ROS_DEBUG("CFollowLPModuleBT::set_follow_restart_dist-> set_follow_restart_dist");
BT::Optional<double> bt_follow_restart_dist = self.getInput<double>("follow_restart_dist");
if (!bt_follow_restart_dist)
{
ROS_ERROR("CFollowLPModuleBT::get_follow_restart_dist-> Incorrect or missing input. It needs the following input ports: follow_restart_dist(double)");
ROS_ERROR("CFollowLPModuleBT::set_follow_restart_dist-> Incorrect or missing input. It needs the following input ports: follow_restart_dist(double)");
return BT::NodeStatus::FAILURE;
}
double follow_restart_dist=bt_follow_restart_dist.value();
if(this->module.get_follow_restart_dist(follow_restart_dist)==DYN_RECONF_SUCCESSFULL)
if(this->module.set_follow_restart_dist(follow_restart_dist)==DYN_RECONF_SUCCESSFULL)
return BT::NodeStatus::SUCCESS;
else
{
ROS_ERROR("CFollowLPModuleBT::set_follow_restart_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
template <class ModuleCfg>
BT::NodeStatus CFollowLPModuleBT<ModuleCfg>::set_follow_restart_dist(BT::TreeNode& self)
BT::NodeStatus CFollowLPModuleBT<ModuleCfg>::get_follow_restart_dist(BT::TreeNode& self)
{
ROS_DEBUG("CFollowLPModuleBT::set_follow_restart_dist-> set_follow_restart_dist");
ROS_DEBUG("CFollowLPModuleBT::get_follow_restart_dist-> get_follow_restart_dist");
double follow_restart_dist;
if(this->module.set_follow_restart_dist(follow_restart_dist)==DYN_RECONF_SUCCESSFULL)
if(this->module.get_follow_restart_dist(follow_restart_dist)==DYN_RECONF_SUCCESSFULL)
{
self.setOutput("follow_restart_dist", follow_restart_dist);
return BT::NodeStatus::SUCCESS;
......@@ -198,6 +209,7 @@ class CFollowLPModuleBT
else
{ //Just beacuse in case of error to put something on the output port
self.setOutput("follow_restart_dist", follow_restart_dist);
ROS_ERROR("CFollowLPModuleBT::get_follow_restart_dist-> Error");
return BT::NodeStatus::FAILURE;
}
}
......@@ -217,7 +229,10 @@ class CFollowLPModuleBT
if(this->module.set_spline_dist_samples(dist_samples)==DYN_RECONF_SUCCESSFULL)
return BT::NodeStatus::SUCCESS;
else
{
ROS_ERROR("CFollowLPModuleBT::set_spline_dist_samples-> Error");
return BT::NodeStatus::FAILURE;
}
}
template <class ModuleCfg>
......@@ -234,6 +249,7 @@ class CFollowLPModuleBT
else
{ //Just beacuse in case of error to put something on the output port
self.setOutput("dist_samples", dist_samples);
ROS_ERROR("CFollowLPModuleBT::get_spline_dist_samples-> Error");
return BT::NodeStatus::FAILURE;
}
}
......
......@@ -172,10 +172,10 @@
<Action ID="nav_module_follow_get_follow_dist">
<output_port name="follow_dist"> Local planner follow_dist parameter</output_port>
</Action>
<Action ID="nav_module_follow_get_follow_restart_dist">
<Action ID="nav_module_follow_set_follow_restart_dist">
<input_port name="follow_restart_dist"> Local planner follow_restart_dist parameter</input_port>
</Action>
<Action ID="nav_module_follow_set_follow_restart_dist">
<Action ID="nav_module_follow_get_follow_restart_dist">
<output_port name="follow_restart_dist"> Local planner follow_restart_dist parameter</output_port>
</Action>
<Action ID="nav_module_follow_set_spline_dist_samples">
......
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