-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControls.h
More file actions
111 lines (89 loc) · 2.06 KB
/
Controls.h
File metadata and controls
111 lines (89 loc) · 2.06 KB
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
// Control.h
#ifndef CONTROL_H
#define CONTROL_H
#include "Resources.h"
//#include "Data.h"
class Data;
class Controls {
public:
Controls();
~Controls();
/// <summary>
/// Moves the base of the robot by outputing
/// PWM signals to the base CIM motors
/// </summary>
void driveBase();
/// <summary>
/// Turns the wheels on the grabbing mechanism
/// to intake the boulder by sending signal to
/// Mini CIM motors
/// </summary>
void intake();
/// <summary>
/// Turns the wheels on the grabbing mechanism
/// in reverse to shoot out the boulder by
/// sending signal to Mini CIM mottors
/// </summary>
void reverseBall();
/// <summary>
/// Turns the wheels on the shooting mechanism
/// to launch the boulder off the ramp by
/// sending signal to Mini CIM motors
/// </summary>
void launchBall();
/// <summary>
/// Trebuchet does something
/// </summary>
void trebuchet();
/// <summary>
/// Lifts the triangle mechanism to lift the
/// porticullis defense
/// </summary>
void liftSpears();
/// <summary>
/// Lowers the triangle mechanism to lower the
/// cheval de frise defense
/// </summary>
void lowerSpears();
/// <summary>
/// Stops the movement of the triangle mechanism
/// </summary>
void stopSpears();
/// <summary>
/// Updates the local variables from the Data
/// class to have consistent values for motor
/// outputs
/// </summary>
void update();
/// <summary>
/// Resets the speed of each talon to 0
/// </summary>
void reset();
/// <summary>
/// Sets all talons to their respective variable value
/// </summary>
void setTalons();
private:
Data *library;
// Drive Talons
Talon talon0;
Talon talon1;
Talon talon2;
Talon talon3;
// Action Talons
CANTalon intake_motor;
CANTalon holding_motor;
CANTalon trebuchet_top_motor;
CANTalon trebuchet_bot_motor;
DoubleSolenoid spearSolenoid;
// moderator for driving
int moderator = 2.0;
// joystick x and y
double j_x, j_y;
// Speed of each drive Talon
double speedR, speedL;
double intake_value;
double hold_value;
double top_value, bottom_value;
};
#endif