9 BT::ReturnStatus
Tick();
18 std::cout <<
"The Condition is true" << std::endl;
20 return NodeStatus::SUCCESS;
28 BT::ReturnStatus
Tick();
38 std::cout <<
"The Action is doing some operations" << std::endl;
39 std::this_thread::sleep_for(std::chrono::milliseconds(500));
42 return NodeStatus::IDLE;
45 std::cout <<
"The Action is doing some others operations" << std::endl;
46 std::this_thread::sleep_for(std::chrono::milliseconds(500));
49 return NodeStatus::IDLE;
52 std::cout <<
"The Action is doing more operations" << std::endl;
53 std::this_thread::sleep_for(std::chrono::milliseconds(500));
56 return NodeStatus::IDLE;
59 std::cout <<
"The Action has succeeded" << std::endl;
60 return NodeStatus::SUCCESS;
67 int main(
int argc,
char* argv[])
72 int tick_time_milliseconds = 1000;
74 seq->AddChild(my_con_1);
75 seq->AddChild(my_act_1);
77 Execute(seq, tick_time_milliseconds);
const std::string & name() const
MyAction(const std::string &name)
ConditionNode(const std::string &name, const NodeParameters ¶meters=NodeParameters())
MyCondition(const std::string &name)
The AsyncActionNode a different thread where the action will be executed.
int main(int argc, char *argv[])
AsyncActionNode ActionNode
The SequenceNode is used to execute a sequence of children. If any child returns RUNNING, previous children will be ticked again.