30 std::cout << name() <<
": Started. Send Request to server." << std::endl;
32 auto Now = [](){
return std::chrono::high_resolution_clock::now(); };
35 TimePoint time_before_reply = initial_time + std::chrono::milliseconds(100);
38 bool reply_received =
false;
40 while( !reply_received )
45 std::cout << name() <<
": Waiting Reply..." << std::endl;
48 if(
Now() >= time_before_reply )
50 reply_received =
true;
57 setStatusRunningAndYield();
63 std::cout << name() <<
": Done. 'Waiting Reply' loop repeated " 64 << count <<
" times" << std::endl;
74 std::cout << name() <<
": cleaning up after an halt()\n" << std::endl;
77 std::cout << name() <<
": cleaning up after SUCCESS\n" << std::endl;
82 std::cout << name() <<
": Halted." << std::endl;
96 <SequenceStar name="sequence"> 97 <MyAsyncAction name="action_A"/> 98 <MyAsyncAction name="action_B"/> 121 std::this_thread::sleep_for( std::chrono::milliseconds(10) );
std::chrono::high_resolution_clock::time_point TimePoint
void registerNodeType(const std::string &ID)
The CoroActionNode class is an ideal candidate for asynchronous actions which need to communicate wit...
void cleanup(bool halted)
NodeStatus tick() override
Method to be implemented by the user.
The BehaviorTreeFactory is used to create instances of a TreeNode at run-time.
std::chrono::high_resolution_clock::time_point Now()
Tree createTreeFromText(const std::string &text, Blackboard::Ptr blackboard=Blackboard::create())
static const char * xml_text
static volatile int count
MyAsyncAction(const std::string &name)