file.cc:19:69: required from here /usr/include/c++/13/ext/aligned_buffer.h:93:28: error: invalid application of ‘sizeof’ to incomplete type ‘aaa::A’ 93 | : std::aligned_storage<sizeof(_Tp), __alignof__(_Tp)> | ^~~~~~~~~~~ /usr/include/c++/13/ext/aligned_buffer.h:93:28: error: invalid application of ‘sizeof’ to incomplete type ‘aaa::A’
ControlNodes and Decorators 必须支持新的节点状态 NodeStatus:SKIPPED
The purpose of this new status is to be returned when a PreCondition is not met. When a Node returns SKIPPED, it is notifying to its parent (ControlNode or Decorator) that it hasn’t been executed.
This particular implementation of sleepcan be interrupted if any node in the tree invokes the method TreeNode::emitWakeUpSignal. This allows the loop to re-tick the tree immediately.
Tree::tickRoot() 已经消失了
1 2 3 4 5 6 7 8
// status = tree.tickOnce(); while(!BT::isStatusCompleted(status) ) { //---- or, even better ------ // tree.tickWhileRunning(sleep_ms); tree.tickOnce(); tree.sleep(sleep_ms); }
Tree::tickWhileRunning is the new default and it has its own internal loop; the first argument is a timeout of the sleep inside the loop.
或者这两个:
Tree::tickExactlyOnce(): equivalent to the old behavior in 3.8+
Tree::tickOnce() is roughly equivalent to tickWhileRunning(0ms). It may potentially tick more than once.
原型: Result BT::TreeNode::getInput(const std::string& key, T& destination ) const [inline]
Read an input port, which, in practice, is an entry in the blackboard. If the blackboard contains a std::string and T is not a string, convertFromString<T>() is used automatically to parse the text.
Load the definition of an entire behavior tree, but don’t instantiate it. You can instantiate it later with BehaviorTreeFactory::createTree(tree_id), where “tree_id” come from the XML attribute <BehaviorTree id="tree_id">
Call tickOnce until the status is different from RUNNING. Note that between one tick and the following one, a Tree::sleep() is used
BT::NodeStatus BT::Tree::tickExactlyOnce()
Tick the root of the tree once, even if a node invoked emitWakeUpSignal()
BT::NodeStatus BT::Tree::tickOnce()
by default, tickOnce() sends a single tick, But as long as there is at least one node of the tree invoking TreeNode::emitWakeUpSignal(), it will be ticked again.