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

Added async_is_tree_start and async_is_tree_stop

parent 27963fb1
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,9 @@ class IriBTBasicNodes
BT::NodeStatus NOP(void);
// functions to check whether start or restart have been demanded by the user
BT::NodeStatus is_not_start_tree(void);
BT::NodeStatus async_is_start_tree(void);
BT::NodeStatus is_not_stop_tree(void);
BT::NodeStatus async_is_stop_tree(void);
// functions set start or restart variables
BT::NodeStatus set_start_tree(void);
......
......@@ -12,7 +12,9 @@ void IriBTBasicNodes::init(IriBehaviorTreeFactory &factory)
factory.registerIriAsyncAction("NOP", std::bind(&IriBTBasicNodes::NOP, this));
factory.registerSimpleCondition("is_not_start_tree", std::bind(&IriBTBasicNodes::is_not_start_tree, this));
factory.registerIriAsyncAction("async_is_start_tree", std::bind(&IriBTBasicNodes::async_is_start_tree, this));
factory.registerSimpleCondition("is_not_stop_tree", std::bind(&IriBTBasicNodes::is_not_stop_tree, this));
factory.registerIriAsyncAction("async_is_stop_tree", std::bind(&IriBTBasicNodes::async_is_stop_tree, this));
factory.registerSimpleAction("set_start_tree", std::bind(&IriBTBasicNodes::set_start_tree, this));
factory.registerSimpleAction("set_stop_tree", std::bind(&IriBTBasicNodes::set_stop_tree, this));
......@@ -33,6 +35,14 @@ BT::NodeStatus IriBTBasicNodes::is_not_start_tree(void)
return BT::NodeStatus::SUCCESS;
}
BT::NodeStatus IriBTBasicNodes::async_is_start_tree(void)
{
if(this->tree_start)
return BT::NodeStatus::SUCCESS;
else
return BT::NodeStatus::RUNNING;
}
BT::NodeStatus IriBTBasicNodes::is_not_stop_tree(void)
{
if(this->tree_stop)
......@@ -41,6 +51,14 @@ BT::NodeStatus IriBTBasicNodes::is_not_stop_tree(void)
return BT::NodeStatus::SUCCESS;
}
BT::NodeStatus IriBTBasicNodes::async_is_stop_tree(void)
{
if(this->tree_stop)
return BT::NodeStatus::SUCCESS;
else
return BT::NodeStatus::RUNNING;
}
BT::NodeStatus IriBTBasicNodes::set_start_tree(void)
{
this->tree_start=true;
......
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