timeout_node.h
Go to the documentation of this file.
1 #ifndef DECORATOR_TIMEOUT_NODE_H
2 #define DECORATOR_TIMEOUT_NODE_H
3 
5 #include <atomic>
6 #include "timer_queue.h"
7 
8 namespace BT
9 {
10 class TimeoutNode : public DecoratorNode
11 {
12  public:
13  TimeoutNode(const std::string& name, unsigned milliseconds);
14 
15  TimeoutNode(const std::string& name, const NodeParameters& params);
16 
18  {
19  static NodeParameters params = {{"msec", "0"}};
20  return params;
21  }
22 
23  private:
24  static TimerQueue& timer()
25  {
26  static TimerQueue timer_queue;
27  return timer_queue;
28  }
29 
30  virtual BT::NodeStatus tick() override;
31 
32  std::atomic<bool> child_halted_;
33  uint64_t timer_id_;
34 
35  unsigned msec_;
37 };
38 }
39 
40 #endif // DEADLINE_NODE_H
static const NodeParameters & requiredNodeParameters()
Definition: timeout_node.h:17
TimeoutNode(const std::string &name, unsigned milliseconds)
static TimerQueue & timer()
Definition: timeout_node.h:24
const std::string & name() const
Definition: tree_node.cpp:92
uint64_t timer_id_
Definition: timeout_node.h:33
std::unordered_map< std::string, std::string > NodeParameters
Definition: tree_node.h:33
std::atomic< bool > child_halted_
Definition: timeout_node.h:32
unsigned msec_
Definition: timeout_node.h:35
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
NodeStatus
Definition: basic_types.h:28
bool read_parameter_from_blackboard_
Definition: timeout_node.h:36


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:32