2
3
4
5
6
7
8
9
10
11
15#include "behaviortree_cpp/decorator_node.h"
16#include "behaviortree_cpp/utils/timer_queue.h"
23
24
25
26
27
28
29
30
31
32
33
34
39 TimeoutNode(
const std::string& name,
unsigned milliseconds)
41 , child_halted_(
false)
44 , read_parameter_from_ports_(
false)
45 , timeout_started_(
false)
47 setRegistrationID(
"Timeout");
50 TimeoutNode(
const std::string& name,
const NodeConfig& config)
52 , child_halted_(
false)
55 , read_parameter_from_ports_(
true)
56 , timeout_started_(
false)
59 ~TimeoutNode()
override
69 static PortsList providedPorts()
71 return { InputPort<
unsigned>(
"msec",
"After a certain amount of time, "
72 "halt() the child if it is still running.") };
81 std::atomic_bool child_halted_ =
false;
85 bool read_parameter_from_ports_;
86 std::atomic_bool timeout_started_ =
false;
87 std::mutex timeout_mutex_;
The DecoratorNode is the base class for nodes that have exactly one child.
Definition: decorator_node.h:19
The TimeoutNode will halt() a running child if the latter has been RUNNING longer than a given time....
Definition: timeout_node.h:37
Definition: action_node.h:24
NodeStatus
Definition: basic_types.h:34
Definition: tree_node.h:105