add code for switching b/w cameras
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / Constants.java
1 package org.usfirst.frc.team3501.robot;
2
3 import edu.wpi.first.wpilibj.DoubleSolenoid;
4 import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
5
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 {
13 public final static int PCM_MODULE_A = 9;
14 public final static int PCM_MODULE_B = 10;
15
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;
20
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;
36
37 }
38
39 public static class DriveTrain {
40 // Limits changes in speed during joystick driving
41 public static final double kADJUST = 8;
42
43 // Drivetrain Motor related ports
44 public static final int DRIVE_FRONT_LEFT = 1;
45 public static final int DRIVE_REAR_LEFT = 2;
46 public static final int DRIVE_FRONT_RIGHT = 6;
47 public static final int DRIVE_REAR_RIGHT = 5;
48
49 // Drivetrain shifter related ports
50 public static final int LEFT_SHIFT_MODULE = PCM_MODULE_B;
51 public static final int LEFT_SHIFT_FORWARD = 6;
52 public static final int LEFT_SHIFT_REVERSE = 3;
53 public static final int RIGHT_SHIFT_MODULE = PCM_MODULE_B;
54 public static final int RIGHT_SHIFT_FORWARD = 2;
55 public static final int RIGHT_SHIFT_REVERSE = 7;
56
57 // Encoder related ports
58 public final static int ENCODER_LEFT_A = 0;
59 public final static int ENCODER_LEFT_B = 1;
60 public final static int ENCODER_RIGHT_A = 3;
61 public final static int ENCODER_RIGHT_B = 4;
62
63 public static final double INCHES_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI)
64 / 256;
65
66 public static double kp = 0.013, ki = 0.000015, kd = -0.002;
67 public static double encoderTolerance = 8.0;
68
69 // Gearing constants
70 public static final Value HIGH_GEAR = DoubleSolenoid.Value.kForward;
71 public static final Value LOW_GEAR = DoubleSolenoid.Value.kReverse;
72 }
73
74 public static class Shooter {
75 public static final int CATAPULT1_MODULE = PCM_MODULE_B;
76 public static final int CATAPULT1_FORWARD = 4;
77 public static final int CATAPULT1_REVERSE = 1;
78 public static final int CATAPULT2_MODULE = PCM_MODULE_A;
79 public static final int CATAPULT2_FORWARD = 0;
80 public static final int CATAPULT2_REVERSE = 1;
81
82 public static final Value SHOOT = Value.kForward;
83 public static final Value RESET = Value.kReverse;
84 public static final double WAIT_TIME = 2.0; // In seconds
85
86 // TODO: test for this time
87
88 }
89
90 public static class IntakeArm {
91 public static final int INTAKE_ROLLER_PORT = 8;
92
93 // for pistons
94 public static final int LEFT_INTAKE_MODULE = PCM_MODULE_A;
95 public static final int LEFT_INTAKE_FORWARD = 5;
96 public static final int LEFT_INTAKE_REVERSE = 2;
97 public static final int RIGHT_INTAKE_MODULE = PCM_MODULE_B;
98 public static final int RIGHT_INTAKE_FORWARD = 5;
99 public static final int RIGHT_INTAKE_REVERSE = 0;
100
101 public static final Value EXTEND = DoubleSolenoid.Value.kForward;
102 public static final Value RETRACT = DoubleSolenoid.Value.kReverse;
103
104 public static final int IN = 1;
105 public static final int STOP = 0;
106 public static final int OUT = -1;
107
108 // for roller
109 public static final double INTAKE_SPEED = 0.7;
110 public static final double OUTPUT_SPEED = -0.7;
111 }
112
113 public static class Auton { // TODO: test for all these values
114 // Defense crossing speeds from -1 to 1
115 public static final double DEFAULT_SPEED = 0.3;
116 public static final double MOAT_SPEED = 0.6;
117 public static final double ROCK_WALL_SPEED = 0.8;
118 public static final double ROUGH_TERRAIN_SPEED = 0.7;
119 public static final double RAMPART_SPEED = 0.4;
120 public static final double LOW_BAR_SPEED = 0.5;
121
122 // Defense crossing times in seconds
123 public static final double DEFAULT_TIME = 10.0;
124 public static final double MOAT_TIME = 7.0;
125 public static final double ROCK_WALL_TIME = 8.0;
126 public static final double ROUGH_TERRAIN_TIME = 6.0;
127 public static final double RAMPART_TIME = 10.0;
128 public static final double LOW_BAR_TIME = 6.0;
129
130 // Time to wait before shooting in seconds
131 public static final double WAIT_TIME = 1.0;
132 }
133
134 public static class CameraFeeds {
135
136 // TODO: what are cam names?
137 public static final String camNameIntake = "";
138 public static final String camNameShooter = "";
139
140 // TODO: img quality?
141 public static final int imgQuality = 0;
142
143 }
144
145 public enum Defense {
146 PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHIVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL, RAMPART, NONE;
147 }
148 }