-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAutonomous.h
62 lines (49 loc) · 1.36 KB
/
Autonomous.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef AUTONOMOUS_H
#define AUTONOMOUS_H
#include "DriveTrain.h"
//#include "Kicker.h"
#include "AutonomousKicker.h"
#include "Vacuum.h"
#define OVER_BUMP_DISTANCE (50.0)
#define AutoState AutoSM.AutoStateVariable
union AutonomousStateMachine_tag {
char AutoStateVariable;
struct Bits_typ{
unsigned Bit7:1;
unsigned Bit6:1;
unsigned Bit5:1;
unsigned Bit4:1;
unsigned Bit3:1;
unsigned Bit2:1;
unsigned Bit1:1;
unsigned Bit0:1;
} Bits;
};
class Autonomous {
public:
Autonomous();
void Process();
void SetKicker(AutonomousKicker *k);
void SetDriveTrain(DriveTrain *dt);
inline int GetProgramNumber() { return 0; }
inline int GetState() { return AutoState; }
inline void ResetState() {AutoState = 0;
AutoDrive->ResetEncoders();
AutoState = 0;
iteration = 1;
distance = 1; // Find the value to stick in here
heading = 0;
wantedTurn = 0;}
void AutonomousStateMachine();
private:
int iteration;
float distance; // Might need to change this datatype to a float.
float heading; //This is the current angle
float wantedTurn;
AutonomousKicker *AutoKicker;
DriveTrain *AutoDrive;
Vacuum *AutoVacuum;
union AutonomousStateMachine_tag AutoSM;
int level;
};
#endif // AUTONOMOUS_H