NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
standing_demo_actions.h
1 // Actions for the standing demo motion demonstration state machine
2 // Authors: Philipp Allgeuer <pallgeuer@ais.uni-bonn.de>
3 // Sebastian Schüller <schuell1@cs.uni-bonn.de>
4 
5 // Ensure header is only included once
6 #ifndef STANDING_DEMO_ACTIONS_H
7 #define STANDING_DEMO_ACTIONS_H
8 
9 // Defines - Joint names
10 #define NAME_HEAD_PITCH "head_pitch"
11 #define NAME_HEAD_YAW "neck_yaw"
12 #define NAME_LEFT_SHOULDER_PITCH "left_shoulder_pitch"
13 #define NAME_LEFT_SHOULDER_ROLL "left_shoulder_roll"
14 #define NAME_LEFT_ELBOW_PITCH "left_elbow_pitch"
15 #define NAME_RIGHT_SHOULDER_PITCH "right_shoulder_pitch"
16 #define NAME_RIGHT_SHOULDER_ROLL "right_shoulder_roll"
17 #define NAME_RIGHT_ELBOW_PITCH "right_elbow_pitch"
18 #define NAME_LEFT_KNEE_PITCH "left_knee_pitch"
19 #define NAME_LEFT_ANKLE_PITCH "left_ankle_pitch"
20 #define NAME_LEFT_ANKLE_ROLL "left_ankle_roll"
21 #define NAME_RIGHT_KNEE_PITCH "right_knee_pitch"
22 #define NAME_RIGHT_ANKLE_PITCH "right_ankle_pitch"
23 #define NAME_RIGHT_ANKLE_ROLL "right_ankle_roll"
24 
25 // Defines - Default seated position
26 #define DSP_HEAD_PITCH 0.00
27 #define DSP_HEAD_YAW 0.00
28 #define DSP_LEFT_SHOULDER_PITCH -0.26
29 #define DSP_LEFT_SHOULDER_ROLL 0.00
30 #define DSP_LEFT_ELBOW_PITCH -0.74
31 #define DSP_RIGHT_SHOULDER_PITCH -0.26
32 #define DSP_RIGHT_SHOULDER_ROLL 0.00
33 #define DSP_RIGHT_ELBOW_PITCH -0.74
34 
35 // Defines - Random parameter ranges
36 #define MIN_NOTHING_DELAY 2.5
37 #define MAX_NOTHING_DELAY 10.0
38 #define MIN_LEG_DANGLE_TIME 5.0
39 #define MAX_LEG_DANGLE_TIME 20.0
40 #define MIN_HEAD_IDLE_TIME 5.0
41 #define MAX_HEAD_IDLE_TIME 20.0
42 #define MIN_POST_MOTION_DELAY 1.0
43 #define MAX_POST_MOTION_DELAY 4.0
44 #define MIN_NUM_MOTIONS 1
45 #define MAX_NUM_MOTIONS 4
46 
47 // Defines - Misc
48 #define MAIN_FN_DELAY 3.0 // Time to wait at the beginning of the main function before doing anything
49 #define INIT_DELAY 5.0 // Time to wait during initialisation before planning the first action
50 #define PRE_ACTION_DELAY 1.0 // Time to wait (after cessation of all previous motion) before executing a new action
51 #define DEFAULT_EFFORT 0.25 // Default effort to use for normal standing-based motions
52 #define RETURN_STANDING_VELOCITY 0.60 // Angular velocity with which to return to the default standing position in the return to standing state
53 #define RETURN_STANDING_EFFORT 0.10 // Effort with which to return to the default standing position in the return to standing state
54 #define LIMB_CONTROL_TIME_BIAS 0.05 // Number of seconds to bias limbControlFinishTime by in order to make reasonably sure limb control is really finished when we query it again
55 
56 // Includes
57 #include <string>
58 
59 // Class forward-declarations
60 namespace statecontroller
61 {
62  class StateQueue;
63 }
64 
65 // Standing demo namespace
66 namespace standing_demo
67 {
68  // Class forward-declarations
69  class StandingDemoSC;
70 
71  // Using declarations
73 
74  // Demo actions
75  enum DemoAction
76  {
77  ACT_DO_NOTHING = 0,
78  ACT_HEAD_IDLE,
79  ACT_PLAY_MOTIONS,
80  ACT_PLAY_MOTIONS_HI,
81  NUM_ACTIONS
82  };
83 
84  // String names of demo actions
85  const std::string DemoActionName[NUM_ACTIONS + 1] =
86  {
87  "DO_NOTHING",
88  "HEAD_IDLE",
89  "PLAY_MOTIONS",
90  "PLAY_MOTIONS_HI",
91  "NUM_ACTIONS"
92  };
93 
94  // Standing demo action class
95  class StandingDemoAction
96  {
97  public:
98  // Static action functions
99  static void ActDoNothing(StandingDemoSC* sc, StateQueue* Q);
100  static void ActHeadIdle(StandingDemoSC* sc, StateQueue* Q);
101  static void ActPlayMotions(StandingDemoSC* sc, StateQueue* Q);
102  static void ActPlayMotionsHI(StandingDemoSC* sc, StateQueue* Q);
103  };
104 }
105 
106 #endif
Implements a dynamic State queue.
Definition: state_controller.h:522