21 static uint16_t uid = 1;
26 : not_initialized_(true),
30 parameters_(parameters)
51 if (prev_status != new_status)
68 throw std::logic_error(
"You can NOT access the blackboard in the constructor." 69 " If you need to access the blackboard before the very first tick(), " 70 " you should override the virtual method TreeNode::onInit()");
129 return str.size() >= 4 && str[0] ==
'$' && str[1] ==
'{' && str.back() ==
'}';
std::condition_variable state_condition_variable_
StatusChangeSignal::Subscriber StatusChangeSubscriber
const std::string & name() const
const Blackboard::Ptr & blackboard() const
void setRegistrationName(const std::string ®istration_name)
registrationName() is set by the BehaviorTreeFactory
const NodeParameters & initializationParameters() const
StatusChangeSignal::CallableFunction StatusChangeCallback
std::shared_ptr< Blackboard > Ptr
StatusChangeSubscriber subscribeToStatusChange(StatusChangeCallback callback)
subscribeToStatusChange is used to attach a callback to a status change. When StatusChangeSubscriber ...
TreeNode(const std::string &name, const NodeParameters ¶meters)
TreeNode main constructor.
std::unordered_map< std::string, std::string > NodeParameters
nonstd::string_view StringView
void notify(CallableArgs...args)
StatusChangeSignal state_change_signal_
const NodeParameters parameters_
NodeStatus status() const
static bool isBlackboardPattern(StringView str)
std::string registration_name_
virtual BT::NodeStatus executeTick()
The method that will be executed to invoke tick(); and setStatus();.
Subscriber subscribe(CallableFunction func)
BT::NodeStatus waitValidStatus()
const std::string & registrationName() const
registrationName is the ID used by BehaviorTreeFactory to create an instance.
void setBlackboard(const Blackboard::Ptr &bb)
virtual BT::NodeStatus tick()=0
Method to be implemented by the user.
void setStatus(NodeStatus new_status)