2
3
4
5
6
7
8
9
10
11
12
16#include "behaviortree_cpp/control_node.h"
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
44 ParallelNode(
const std::string& name);
46 ParallelNode(
const std::string& name,
const NodeConfig& config);
48 static PortsList providedPorts()
50 return { InputPort<
int>(THRESHOLD_SUCCESS, -1,
51 "number of children that need to succeed to trigger a "
53 InputPort<
int>(THRESHOLD_FAILURE, 1,
54 "number of children that need to fail to trigger a "
58 ~ParallelNode()
override =
default;
65 virtual void halt()
override;
67 size_t successThreshold()
const;
68 size_t failureThreshold()
const;
69 void setSuccessThreshold(
int threshold);
70 void setFailureThreshold(
int threshold);
73 int success_threshold_;
74 int failure_threshold_;
76 std::set<size_t> completed_list_;
78 size_t success_count_ = 0;
79 size_t failure_count_ = 0;
81 bool read_parameter_from_ports_;
82 static constexpr const char* THRESHOLD_SUCCESS =
"success_count";
83 static constexpr const char* THRESHOLD_FAILURE =
"failure_count";
The ControlNode is the base class for nodes that can have multiple children.
Definition: control_node.h:32
The ParallelNode execute all its children concurrently, but not in separate threads!
Definition: parallel_node.h:42
virtual void halt() override
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105