Replies: 1 comment 1 reply
-
If it was private, derived class would not be able to call it. In the example you mentioned ( About the fact that RUNNING "clutters the output", I think it is a personal opinion. I find that useful. So, I will not make it private because it is still useful for unit testing, but I may agree that removing those intermediate changes in some nodes might be considered |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
TreeNode
type has the protectedvoid setStatus(NodeStatus);
method however I'm unsure of its purpose and why it's protected rather than private.The method is called by
TreeNode::executeTick()
after executing the virtualtick()
along with pre-/post-conditions.BehaviorTree.CPP/src/tree_node.cpp
Lines 131 to 134 in 3073f29
Given this method is protected, it can by, and is, called by several derived types near the beginning of
tick()
implementations, typically control and decorator nodes, but also subtreesBehaviorTree.CPP/src/controls/reactive_sequence.cpp
Lines 25 to 32 in 3073f29
BehaviorTree.CPP/src/decorators/inverter_node.cpp
Lines 23 to 25 in 3073f29
BehaviorTree.CPP/src/decorators/subtree_node.cpp
Lines 21 to 27 in 3073f29
I'd like to understand the expected contract when deriving
TreeNode
; should derived types callsetStatus
withinTreeNode::tick
overrides or let it be invoked by theTreeStatus::executeTick
function?One tangible impact on this design is that trace files become very noisy for certain trees.
Every time a tree like this is ticked, even without any of the nodes changing statuses, the trace resembles this:
In practice, all of the nodes in this example are synchronous
IDLE -> SUCCESS
, so the intermediaryRUNNING
clutters the output, making the trace files less useful than they otherwise could be.Beta Was this translation helpful? Give feedback.
All reactions