2
3
4
5
6
7
8
9
10
11
12
16#include "behaviortree_cpp/decorator_node.h"
22
23
24
25
26
27
28
29
30
31
35 RunOnceNode(
const std::string& name,
const NodeConfig& config)
38 setRegistrationID(
"RunOnce");
41 static PortsList providedPorts()
43 return { InputPort<
bool>(
"then_skip",
true,
44 "If true, skip after the first execution, "
45 "otherwise return the same NodeStatus returned once by the "
52 bool already_ticked_ =
false;
61 if(
auto const res = getInput<
bool>(
"then_skip"))
68 return skip ?
NodeStatus::SKIPPED : returned_status_;
74 if(isStatusCompleted(status))
76 already_ticked_ =
true;
77 returned_status_ = status;
The DecoratorNode is the base class for nodes that have exactly one child.
Definition: decorator_node.h:19
The RunOnceNode is used when you want to execute the child only once. If the child is asynchronous,...
Definition: run_once_node.h:33
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.
void setStatus(NodeStatus new_status)
setStatus changes the status of the node. it will throw if you try to change the status to IDLE,...
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105