action_test_node.h
Go to the documentation of this file.
1 #ifndef ACTIONTEST_H
2 #define ACTIONTEST_H
3 
5 
6 namespace BT
7 {
9 {
10  public:
11  SyncActionTest(const std::string& name);
12 
13  BT::NodeStatus tick() override;
14 
15  void setBoolean(bool boolean_value);
16 
17  int tickCount() const
18  {
19  return tick_count_;
20  }
21 
22  void resetTicks()
23  {
24  tick_count_ = 0;
25  }
26 
27  private:
30 };
31 
33 {
34  public:
35  AsyncActionTest(const std::string& name, BT::Duration deadline_ms);
36 
37  ~AsyncActionTest();
38 
39  // The method that is going to be executed by the thread
40  BT::NodeStatus tick() override;
41 
42  void setTime(BT::Duration time);
43 
44  // The method used to interrupt the execution of the node
45  virtual void halt() override;
46 
47  void setBoolean(bool boolean_value);
48 
49  int tickCount() const
50  {
51  return tick_count_;
52  }
53 
54  void resetTicks()
55  {
56  tick_count_ = 0;
57  }
58 
59  private:
60  // using atomic because these variables might be accessed from different threads
62  std::atomic_bool boolean_value_;
63  std::atomic<int> tick_count_;
64  std::atomic_bool stop_loop_;
65 };
66 }
67 
68 #endif
std::atomic_bool boolean_value_
SyncActionTest(const std::string &name)
const std::string & name() const
Name of the instance, not the type.
Definition: tree_node.cpp:73
The AsyncActionNode uses a different thread where the action will be executed.
Definition: action_node.h:105
void setBoolean(bool boolean_value)
The SyncActionNode is an ActionNode that explicitly prevents the status RUNNING and doesn&#39;t require a...
Definition: action_node.h:52
std::atomic< int > tick_count_
virtual void halt() overridefinal
You don&#39;t need to override this.
Definition: action_node.h:63
BT::NodeStatus tick() override
Method to be implemented by the user.
std::atomic_bool stop_loop_
int tickCount() const
NodeStatus
Definition: basic_types.h:35
int tickCount() const
std::chrono::high_resolution_clock::duration Duration
Definition: basic_types.h:339


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sat Jun 8 2019 18:04:04