LRT13  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
ClimberData.h
1 #ifndef CLIMBER_DATA_H
2 #define CLIMBER_DATA_H
3 
4 #include "ComponentData.h"
5 
6 namespace data
7 {
12 namespace climber
13 {
14 typedef enum state
15  {
16  NOTHING = -1,
17  BEGIN = 0,
18  LINE_UP = 1,
19  HOOKS_DOWN = 2,
20  ARMS_UP = 3,
21  ARMS_DOWN = 4,
22  CLIMB_PREPARE = 5,
23  HOOKS_UP = 6,
24  CLIMB = 7,
25  DEBUG_MODE = 100,
26 
27 // IDLE = 1,
28 // ARM_UP_INITIAL = 2,
29 // WAIT = 3,
30 // ARM_DOWN = 4,
31 // ENGAGE_PTO = 5,
32 // WINCH_UP = 6,
33 // ENGAGE_HOOKS = 7,
34 // DISENGAGE_PTO = 8,
35 // ARM_UP_FINAL = 9,
36 // DUMB_ENGAGE_PTO = 10,
37 // UNLOCK_PAWL = 11,
38 // PREPARE_CLIMBING_POSITION = 12,
39 // DO_NOTHING= 13
40  };
41 
42 typedef enum ClimbState
43 {
44  GROUND = 0,
45  TEN_POINT = 1,
46  TWENTY_POINT = 2,
47  THIRTY_POINT = 3
48 };
49 
50 typedef enum humanState
51 {
52  INTENDED_IDLE = 1,
53  INTENDED_ARM_UP = 2,
54  INTENDED_CLIMBING = 3
55 };
56  class ClimberData
57  {
58  //Define desired state (what part of climb im working on)
59  //Keep track of current state (what part of climb im working on: done, in progress; starting)
60  public:
61  ClimberData();
62  humanState getDesiredClimbingStep();
63  void setDesiredClimbingStep(humanState newState);
64  bool shouldContinueClimbing();
65  bool shouldForceContinueClimbing();
66  void setShouldContinueClimbing(bool shouldContinue);
67  void setShouldForceContinueClimbing(bool shouldContinue);
68 
69  bool shouldPotentiallyAbort();
70  void setShouldPotentiallyAbort(bool shouldAbort);
71 
72  //Debug functions
73  bool shouldDebug();
74  void enableDebug();
75  void disableDebug();
76 
77  void changeArmState();
78 
79  bool shouldChangeAngleState();
80  void changeAngleState();
81 
82  bool shouldWinchPawlGoUp();
83  bool shouldWinchPawlGoDown();
84  void winchPawlUp();
85  void winchPawlDown();
86  void winchPawlInactive();
87 
88  double winchPawlCurrent();
89  void setWinchPawlCurrent(double value);
90 
91  bool shouldPTOChangeDisengage();
92  bool shouldPTOChangeEngage();
93  void EngagePTO();
94  void DisengagePTO();
95 
96  void changeHooks();
97 
98  bool shouldChangeHooks();
99 
100  void extendArm();
101  void retractArm();
102 
103  bool shouldArmsUp();
104  bool shouldArmsChange();
105 
106  void setDesiredState(state target);
107  state getDesiredState();
108  void setCurrentState(state newState);
109  state getCurrentState();
110  void setWaitingState(state newState);
111  state getWaitingState();
112  void setShouldHooksChange(bool hooksDown);
113  bool shouldHooksChange();
114 
115  bool isPTOEngaged();
116  void setPTOEngaged(bool engaged);
117  private:
118  humanState m_desiredClimbingStep;
119  bool m_shouldContinueClimbing, m_shouldForceContinueClimbing;
120 
121  bool m_shouldPotentiallyAbort;
122 
123  bool m_shouldWinchPawlGoUp;
124  bool m_shouldWinchPawlGoDown;
125 
126  bool m_shouldPTOEngage;
127  bool m_shouldPTODisEngage;
128  bool m_PTOEngaged;
129 
130  bool m_shoulddebug;
131 
132  bool m_armState;
133  bool m_shouldChangeArm;
134 
135  bool m_shouldHooksChange;
136 
137  double m_winchPawlCurrent;
138 
139  state m_desiredState;
140  state m_currentState;
141  state m_waitingState;
142  };
143 }
144 }
145 
146 #endif