/
TinMan.h
78 lines (54 loc) · 1.82 KB
/
TinMan.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef TinMan_h
#define TinMan_h
#include "WPILib.h"
#include "RobotDefines.h"
class DriveTrain;
class Shooter;
class Climber;
//******************************************************************************
//******************************************************************************
class TinMan : public SimpleRobot
{
public:
//*** constructor ***
TinMan(void);
//*** destructor ***
virtual ~TinMan(void);
//*** autonomous mode code ***
void Autonomous(void);
//*** teleop code ***
void OperatorControl(void);
//*** test mode ***
void Test(void);
//*** check inputs for each subsystem ***
void checkInputs();
//*** check real-time inputs for each subsystem ***
void checkRealTimeInputs();
//*** indicates DS thread should be cancelled ***
bool dsThreadCancel() { return cancelDsThread_; };
//*** indicates DS thread should be cancelled ***
bool rtThreadCancel() { return cancelRtThread_; };
protected:
//*** SUBSYSTEMS ***
DriveTrain *drive_; // robot drive subsystem
Shooter *shooter_; // frisbee shooter subsystem
Climber *climber_; // Climber subsystem
//*** INPUT ***
Joystick *driveStick_; // Drive joystick
Joystick *throwerStick_; // Thrower control joystick
//*** MISC VARIABLES ***
Task dsTask_; // Driverstation task
Task rtTask_; // Real Time input task
bool cancelDsThread_; // flag to cancel ds thread
bool cancelRtThread_; // flag to cancel rt thread
bool initialized_; // initialized flag
void initialize();
//*** THREADS ***
//*** DriverStation thread ***
static void dsTask( TinMan* p );
//*** RealTime update thread ***
static void rtTask( TinMan *p );
//*** for autonomous ***
bool waitTillFinished( DriveTrain* dt );
};
#endif