NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
wak_beh_state.h
1 // Walk and kick: Behaviour states base implementation
2 // Author: Philipp Allgeuer <pallgeuer@ais.uni-bonn.de>
3 
4  // Ensure header is only included once
5 #ifndef WAK_BEH_STATE_H
6 #define WAK_BEH_STATE_H
7 
8 // Includes
9 #include <walk_and_kick/wak_common.h>
10 #include <walk_and_kick/wak_config.h>
11 #include <walk_and_kick/wak_beh_shared.h>
12 #include <walk_and_kick/wak_game_shared.h>
13 #include <walk_and_kick/wak_game_vars.h>
14 #include <walk_and_kick/wak_sensor_vars.h>
15 #include <walk_and_kick/wak_actuator_vars.h>
16 #include <walk_and_kick/wak_ros_interface.h>
17 #include <walk_and_kick/wak_utils.h>
18 
19 // Walk and kick namespace
20 namespace walk_and_kick
21 {
28  {
29  public:
30  // Constructor
31  WAKBehState(WAKConfig& config, const SensorVars& SV, const WAKBehShared& WBS, const WAKGameShared& WGS, int ID);
32  virtual ~WAKBehState() {}
33 
34  // Config parameters
35  WAKConfig& config;
36 
37  // Sensor variables
38  const SensorVars& SV;
39 
40  // Shared behaviour variables
41  const WAKBehShared& WBS;
42 
43  // Game variables
44  const GameVars& GV;
45 
46  // Shared game variables
47  const WAKGameShared& WGS;
48 
49  // Field dimensions
50  const FieldDimensions& field;
51 
52  // Plot manager
53  plot_msgs::PlotManagerFS& PM;
54 
55  // Marker manager
56  WAKMarkerMan& MM;
57 
58  // Reset function
59  void reset() { deactivate(); }
60 
61  // Get functions
62  int id() const { return m_id; }
63  std::string name() const { return m_name; }
64  const std::string& nameRef() const { return m_name; }
65  bool isActive() const { return m_active; }
66 
67  // Activation and deactivation functions
68  void activate() { m_active = true; handleActivation(true); }
69  void deactivate() { m_active = false; handleActivation(false); }
70 
71  // Execute function
72  virtual void execute(ActuatorVars& AV, const ActuatorVars& lastAV, bool justActivated) { AV.reset(); }
73 
74  protected:
75  // Handle activation function
76  virtual void handleActivation(bool nowActive) {}
77 
78  private:
79  // Internal variables
80  int m_id;
81  std::string m_name;
82  bool m_active;
83  };
84 }
85 
86 #endif
87 // EOF
Configuration struct for the walk and kick node.
Definition: wak_config.h:20
Visualisation marker manager for the walk and kick node.
Definition: wak_vis.h:21
An interface class for encapsulating all of the ROS input data to the walk and kick node...
Definition: wak_sensor_vars.h:29
A class that shares the required walk and kick variables amongst the game state classes.
Definition: wak_game_shared.h:31
A simple class for abstracting away the source of the field dimensions.
Definition: wak_utils.h:216
The base class for all walk and kick behaviour states.
Definition: wak_beh_state.h:27
An interface class for encapsulating all of the data that the walk and kick game states should comman...
Definition: wak_game_vars.h:21
A class that shares the required walk and kick variables amongst the behaviour state classes...
Definition: wak_beh_shared.h:48
An interface class for encapsulating all of the data that the walk and kick behaviour states should c...
Definition: wak_actuator_vars.h:22