-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDriverInput.h
142 lines (114 loc) · 3.53 KB
/
DriverInput.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#ifndef DRIVER_INPUT_H__
#define DRIVER_INPUT_H__
#include <cmath>
#include "WPILib.h"
#include "DriverStationLCD.h"
#include "MultiToggle.h"
class DriverInput
{
// Actual hardware
static Joystick * m_left_stick;
static Joystick * m_right_stick;
static Joystick * m_third_stick;
// Cached info
static float m_left_speed;
static float m_right_speed;
static float m_upper_speed; // thse are for the grabber
static float m_lower_speed;
static bool b_line_follow;
static bool retsetDIP_button;
static bool reloadConfig;
static bool m_capture;
static bool m_release;
static bool m_rotate_up;
static bool m_rotate_down;
static bool m_toggle_direction;
static bool b_shuttle_button_1;
static bool b_shuttle_button_2;
static bool b_shuttle_button_3;
static float shuttleSpeed;
static float armSpeed;
static bool b_arm_button_1;
static bool b_arm_button_2;
static bool b_select_position_1;
static bool b_select_position_2;
static bool b_select_position_3;
static bool b_select_position_4;
static bool b_select_position_5;
static bool b_select_position_6;
static bool b_select_position_7;
static bool b_select_position_8;
static bool b_select_position_9;
static bool b_pick_up_ground;
static bool b_select_position_stow;
static bool b_select_position_slot;
static bool b_travel_straight_up;
static bool b_operating_orientation_selector;
static bool b_goto_button;
static bool b_gyro_reset_button;
static bool b_manual_override;
static bool b_deploy_extend;
static bool b_deploy_retract;
static bool b_alignment_release;
static DriverStationEnhancedIO * dseio;
static float DeadbandJoystick(float input) {
if (::fabs(input) < kDeadband) {
return 0;
}
return input;
}
static MultiToggle * m_signal_light_toggle;
public:
static float GetLeftSpeed();
static float GetRightSpeed();
static bool GetLineFollowButton();
static bool GetPIDTesterButton();
static bool ReloadConfig();
static float GetUpperGrabberSpeed();
static float GetLowerGrabberSpeed();
/*static bool LineToggle();*/
static Joystick * GetLeftJoy();
static Joystick * GetRightJoy();
static Joystick * GetThirdJoy();
static bool GetRotateUp() { return m_rotate_up; }
static bool GetRotateDown() { return m_rotate_down; }
static bool GetCapture() { return m_capture; }
static bool GetRelease() { return m_release; }
static bool LineToggle();
static bool GetResetGyroButton();
static void ForceManualOff() { b_manual_override = false; }
static float GetShuttleSpeed();
static bool GetShut1();
static bool GetShut2();
static bool GetShut3();
static bool GetArmPosition1();
static bool GetArmPosition2();
static float GetArmSpeed();
//These are for the 15 or something buttons above.
static bool GetIO1();
static bool GetIO2();
static bool GetIO3();
static bool GetIO4();
static bool GetIO5();
static bool GetIO6();
static bool GetIO7();
static bool GetIO8();
static bool GetIO9();
static bool GetPickUpG();
static bool GetSelStow();
static bool GetSelSlot();
static bool GetTravelUp();
static bool GetSelOperOrient();
static bool GoToButton();
static bool GetManualOverride();
static bool GetDeployExtend();
static bool GetDeployRetract();
static bool GetAlignmentRelease();
static int GetSignalLightChoice() { return m_signal_light_toggle->Get(); }
static void Init();
static void Process();
static const float kDeadband;
private:
DriverInput() {} ;
};
#endif