5 #ifndef SITTING_DEMO_ACTIONS_H
6 #define SITTING_DEMO_ACTIONS_H
9 #define NAME_HEAD_PITCH "head_pitch"
10 #define NAME_HEAD_YAW "neck_yaw"
11 #define NAME_LEFT_SHOULDER_PITCH "left_shoulder_pitch"
12 #define NAME_LEFT_SHOULDER_ROLL "left_shoulder_roll"
13 #define NAME_LEFT_ELBOW_PITCH "left_elbow_pitch"
14 #define NAME_RIGHT_SHOULDER_PITCH "right_shoulder_pitch"
15 #define NAME_RIGHT_SHOULDER_ROLL "right_shoulder_roll"
16 #define NAME_RIGHT_ELBOW_PITCH "right_elbow_pitch"
17 #define NAME_LEFT_KNEE_PITCH "left_knee_pitch"
18 #define NAME_LEFT_ANKLE_PITCH "left_ankle_pitch"
19 #define NAME_LEFT_ANKLE_ROLL "left_ankle_roll"
20 #define NAME_RIGHT_KNEE_PITCH "right_knee_pitch"
21 #define NAME_RIGHT_ANKLE_PITCH "right_ankle_pitch"
22 #define NAME_RIGHT_ANKLE_ROLL "right_ankle_roll"
25 #define DSP_HEAD_PITCH 0.00
26 #define DSP_HEAD_YAW 0.00
27 #define DSP_LEFT_SHOULDER_PITCH -0.26
28 #define DSP_LEFT_SHOULDER_ROLL 0.00
29 #define DSP_LEFT_ELBOW_PITCH -0.74
30 #define DSP_RIGHT_SHOULDER_PITCH -0.26
31 #define DSP_RIGHT_SHOULDER_ROLL 0.00
32 #define DSP_RIGHT_ELBOW_PITCH -0.74
33 #define DSP_LEFT_KNEE_PITCH 0.80
34 #define DSP_LEFT_ANKLE_PITCH 0.00
35 #define DSP_LEFT_ANKLE_ROLL 0.00
36 #define DSP_RIGHT_KNEE_PITCH 0.80
37 #define DSP_RIGHT_ANKLE_PITCH 0.00
38 #define DSP_RIGHT_ANKLE_ROLL 0.00
41 #define MIN_NOTHING_DELAY 2.5
42 #define MAX_NOTHING_DELAY 10.0
43 #define MIN_LEG_DANGLE_TIME 5.0
44 #define MAX_LEG_DANGLE_TIME 20.0
45 #define MIN_HEAD_IDLE_TIME 5.0
46 #define MAX_HEAD_IDLE_TIME 20.0
47 #define MIN_POST_MOTION_DELAY 1.0
48 #define MAX_POST_MOTION_DELAY 4.0
49 #define MIN_NUM_MOTIONS 1
50 #define MAX_NUM_MOTIONS 4
53 #define MAIN_FN_DELAY 3.0 // Time to wait at the beginning of the main function before doing anything
54 #define INIT_DELAY 5.0 // Time to wait during initialisation before planning the first action
55 #define PRE_ACTION_DELAY 1.0 // Time to wait (after cessation of all previous motion) before executing a new action
56 #define DEFAULT_EFFORT 0.25 // Default effort to use for normal sitting-based motions
57 #define RETURN_SITTING_VELOCITY 0.60 // Angular velocity with which to return to the default sitting position in the return to sitting state
58 #define RETURN_SITTING_EFFORT 0.10 // Effort with which to return to the default sitting position in the return to sitting state
59 #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
65 namespace statecontroller
71 namespace sitting_demo
85 ACT_LEG_DANGLE_HEAD_IDLE,
89 ACT_PLAY_MOTIONS_LD_HI,
94 const std::string DemoActionName[NUM_ACTIONS + 1] =
99 "LEG_DANGLE_HEAD_IDLE",
103 "PLAY_MOTIONS_LD_HI",
108 class SittingDemoAction
112 static void ActDoNothing(SittingDemoSC* sc, StateQueue* Q);
113 static void ActLegDangle(SittingDemoSC* sc, StateQueue* Q);
114 static void ActHeadIdle(SittingDemoSC* sc, StateQueue* Q);
115 static void ActLegDangleHeadIdle(SittingDemoSC* sc, StateQueue* Q);
116 static void ActPlayMotions(SittingDemoSC* sc, StateQueue* Q);
117 static void ActPlayMotionsLD(SittingDemoSC* sc, StateQueue* Q);
118 static void ActPlayMotionsHI(SittingDemoSC* sc, StateQueue* Q);
119 static void ActPlayMotionsLDHI(SittingDemoSC* sc, StateQueue* Q);
Implements a dynamic State queue.
Definition: state_controller.h:522