Commit | Line | Data |
---|---|---|
38a404b3 KZ |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
9b10474d | 3 | import edu.wpi.first.wpilibj.DoubleSolenoid; |
2a099bc6 | 4 | import edu.wpi.first.wpilibj.DoubleSolenoid.Value; |
9b10474d | 5 | |
38a404b3 KZ |
6 | /** |
7 | * The Constants stores constant values for all subsystems. This includes the | |
8 | * port values for motors and sensors, as well as important operational | |
9 | * constants for subsystems such as max and min values. | |
10 | */ | |
11 | ||
12 | public class Constants { | |
e4fbab02 HD |
13 | public final static int PCM_MODULE_A = 9; |
14 | public final static int PCM_MODULE_B = 10; | |
15 | ||
200caf63 KZ |
16 | public static class OI { |
17 | // Computer Ports | |
18 | public final static int LEFT_STICK_PORT = 0; | |
19 | public final static int RIGHT_STICK_PORT = 1; | |
2c9bcd75 | 20 | |
e1f7a742 HD |
21 | // Left Joystick |
22 | public final static int LEFT_JOYSTICK_GEAR_SHIFT_PORT = 1; | |
23 | public final static int LEFT_JOYSTICK_EXTEND_INTAKE_1_PORT = 3; | |
24 | public final static int LEFT_JOYSTICK_EXTEND_INTAKE_2_PORT = 5; | |
25 | public final static int LEFT_JOYSTICK_RETRACT_INTAKE_1_PORT = 4; | |
26 | public final static int LEFT_JOYSTICK_RETRACT_INTAKE_2_PORT = 6; | |
27 | public final static int LEFT_JOYSTICK_TOGGLE_FRONT_PORT = 7; | |
28 | ||
29 | // Right Joystick | |
30 | public final static int RIGHT_JOYSTICK_INTAKE_PORT = 1; | |
31 | public final static int RIGHT_JOYSTICK_OUTTAKE_1_PORT = 3; | |
32 | public final static int RIGHT_JOYSTICK_OUTTAKE_2_PORT = 4; | |
33 | public final static int RIGHT_JOYSTICK_SHOOTER_UP_PORT = 2; | |
34 | public final static int RIGHT_JOYSTICK_SHOOTER_DOWN_1_PORT = 5; | |
35 | public final static int RIGHT_JOYSTICK_SHOOTER_DOWN_2_PORT = 6; | |
52ef246c | 36 | |
200caf63 | 37 | } |
38a404b3 | 38 | |
200caf63 | 39 | public static class DriveTrain { |
ba29a57a HD |
40 | public static final int TANK = 0; |
41 | public static final int ARCADE = 1; | |
42 | public static final int DRIVE_TYPE = TANK; | |
43338192 | 43 | |
116863c5 HD |
44 | // Limits changes in speed during joystick driving |
45 | public static final double kADJUST = 8; | |
46 | ||
43338192 | 47 | // Drivetrain Motor related ports |
949415d0 HD |
48 | public static final int DRIVE_FRONT_LEFT = 1; |
49 | public static final int DRIVE_REAR_LEFT = 2; | |
50 | public static final int DRIVE_FRONT_RIGHT = 6; | |
51 | public static final int DRIVE_REAR_RIGHT = 5; | |
27615e61 | 52 | |
43338192 | 53 | // Drivetrain shifter related ports |
e1f7a742 | 54 | public static final int LEFT_SHIFT_MODULE = PCM_MODULE_B; |
eeb6c3d9 HD |
55 | public static final int LEFT_SHIFT_FORWARD = 6; |
56 | public static final int LEFT_SHIFT_REVERSE = 3; | |
e1f7a742 HD |
57 | public static final int RIGHT_SHIFT_MODULE = PCM_MODULE_B; |
58 | public static final int RIGHT_SHIFT_FORWARD = 2; | |
59 | public static final int RIGHT_SHIFT_REVERSE = 7; | |
45bdf5b9 | 60 | |
43338192 HD |
61 | // Encoder related ports |
62 | public final static int ENCODER_LEFT_A = 0; | |
63 | public final static int ENCODER_LEFT_B = 1; | |
64 | public final static int ENCODER_RIGHT_A = 3; | |
65 | public final static int ENCODER_RIGHT_B = 4; | |
66 | ||
b1678339 ME |
67 | public static final double INCHES_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) |
68 | / 256; | |
33141cdd | 69 | |
fb75626b | 70 | public static double kp = 0.013, ki = 0.000015, kd = -0.002; |
f8bfcc62 | 71 | public static double encoderTolerance = 8.0; |
2a099bc6 KZ |
72 | |
73 | // Gearing constants | |
74 | public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward; | |
75 | public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse; | |
200caf63 | 76 | } |
38a404b3 | 77 | |
200caf63 | 78 | public static class Shooter { |
e1f7a742 HD |
79 | public static final int CATAPULT1_MODULE = PCM_MODULE_B; |
80 | public static final int CATAPULT1_FORWARD = 4; | |
00cf1e6c | 81 | public static final int CATAPULT1_REVERSE = 1; |
a68e4347 | 82 | public static final int CATAPULT2_MODULE = PCM_MODULE_A; |
e1f7a742 HD |
83 | public static final int CATAPULT2_FORWARD = 0; |
84 | public static final int CATAPULT2_REVERSE = 1; | |
e4fbab02 | 85 | |
7988f380 HD |
86 | public static final Value SHOOT = Value.kForward; |
87 | public static final Value RESET = Value.kReverse; | |
e4fbab02 | 88 | public static final double WAIT_TIME = 2.0; // In seconds |
b1678339 ME |
89 | |
90 | // TODO: test for this time | |
b1678339 | 91 | |
200caf63 | 92 | } |
40348cab | 93 | |
200caf63 | 94 | public static class IntakeArm { |
e1f7a742 | 95 | public static final int INTAKE_ROLLER_PORT = 8; |
5cff8910 ME |
96 | |
97 | // for pistons | |
a68e4347 | 98 | public static final int LEFT_INTAKE_MODULE = PCM_MODULE_A; |
e1f7a742 HD |
99 | public static final int LEFT_INTAKE_FORWARD = 5; |
100 | public static final int LEFT_INTAKE_REVERSE = 2; | |
101 | public static final int RIGHT_INTAKE_MODULE = PCM_MODULE_B; | |
102 | public static final int RIGHT_INTAKE_FORWARD = 5; | |
103 | public static final int RIGHT_INTAKE_REVERSE = 0; | |
5cff8910 | 104 | |
2781cca0 ME |
105 | public static final Value EXTEND = DoubleSolenoid.Value.kForward; |
106 | public static final Value RETRACT = DoubleSolenoid.Value.kReverse; | |
107 | ||
e1f7a742 | 108 | public static final int IN = 1; |
ba29a57a | 109 | public static final int STOP = 0; |
e1f7a742 HD |
110 | public static final int OUT = -1; |
111 | ||
5cff8910 | 112 | // for roller |
116863c5 HD |
113 | public static final double INTAKE_SPEED = 0.7; |
114 | public static final double OUTPUT_SPEED = -0.7; | |
200caf63 | 115 | } |
9e9154af | 116 | |
0022ac84 | 117 | public static class Auton { // TODO: test for all these values |
f53566b3 | 118 | // Defense crossing speeds from -1 to 1 |
b378dfef | 119 | public static final double DEFAULT_SPEED = 0.3; |
f53566b3 HD |
120 | public static final double MOAT_SPEED = 0.6; |
121 | public static final double ROCK_WALL_SPEED = 0.8; | |
b378dfef | 122 | public static final double ROUGH_TERRAIN_SPEED = 0.7; |
5c706789 | 123 | public static final double RAMPART_SPEED = 0.4; |
b378dfef | 124 | public static final double LOW_BAR_SPEED = 0.5; |
f53566b3 HD |
125 | |
126 | // Defense crossing times in seconds | |
b378dfef HD |
127 | public static final double DEFAULT_TIME = 10.0; |
128 | public static final double MOAT_TIME = 7.0; | |
129 | public static final double ROCK_WALL_TIME = 8.0; | |
130 | public static final double ROUGH_TERRAIN_TIME = 6.0; | |
5c706789 | 131 | public static final double RAMPART_TIME = 10.0; |
b378dfef | 132 | public static final double LOW_BAR_TIME = 6.0; |
f53566b3 HD |
133 | |
134 | // Time to wait before shooting in seconds | |
135 | public static final double WAIT_TIME = 1.0; | |
136 | } | |
137 | ||
9e9154af HD |
138 | public enum Defense { |
139 | PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHIVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL, RAMPART; | |
140 | } | |
38a404b3 | 141 | } |