The AsyncActionNode uses a different thread where the action will be executed. More...
#include <action_node.h>
Public Member Functions | |
AsyncActionNode (const std::string &name, const NodeConfiguration &config) | |
virtual NodeStatus | executeTick () override final |
The method that should be used to invoke tick() and setStatus();. | |
void | stopAndJoinThread () |
virtual | ~AsyncActionNode () override |
Private Member Functions | |
void | asyncThreadLoop () |
void | notifyStart () |
void | waitStart () |
Private Attributes | |
std::exception_ptr | exptr_ |
std::atomic< bool > | keep_thread_alive_ |
bool | start_action_ |
std::mutex | start_mutex_ |
std::condition_variable | start_signal_ |
std::thread | thread_ |
The AsyncActionNode uses a different thread where the action will be executed.
The user must implement the methods tick() and halt().
Definition at line 105 of file action_node.h.
BT::AsyncActionNode::AsyncActionNode | ( | const std::string & | name, |
const NodeConfiguration & | config | ||
) |
Definition at line 54 of file action_node.cpp.
BT::AsyncActionNode::~AsyncActionNode | ( | ) | [override, virtual] |
Definition at line 62 of file action_node.cpp.
void BT::AsyncActionNode::asyncThreadLoop | ( | ) | [private] |
Definition at line 87 of file action_node.cpp.
NodeStatus BT::AsyncActionNode::executeTick | ( | ) | [override, virtual] |
The method that should be used to invoke tick() and setStatus();.
Reimplemented from BT::TreeNode.
Definition at line 112 of file action_node.cpp.
void BT::AsyncActionNode::notifyStart | ( | ) | [private] |
Definition at line 80 of file action_node.cpp.
Definition at line 129 of file action_node.cpp.
void BT::AsyncActionNode::waitStart | ( | ) | [private] |
Definition at line 70 of file action_node.cpp.
std::exception_ptr BT::AsyncActionNode::exptr_ [private] |
Definition at line 134 of file action_node.h.
std::atomic<bool> BT::AsyncActionNode::keep_thread_alive_ [private] |
Definition at line 126 of file action_node.h.
bool BT::AsyncActionNode::start_action_ [private] |
Definition at line 128 of file action_node.h.
std::mutex BT::AsyncActionNode::start_mutex_ [private] |
Definition at line 130 of file action_node.h.
std::condition_variable BT::AsyncActionNode::start_signal_ [private] |
Definition at line 132 of file action_node.h.
std::thread BT::AsyncActionNode::thread_ [private] |
Definition at line 136 of file action_node.h.