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 { | |
200caf63 KZ |
13 | public static class OI { |
14 | // Computer Ports | |
15 | public final static int LEFT_STICK_PORT = 0; | |
16 | public final static int RIGHT_STICK_PORT = 1; | |
2c9bcd75 CZ |
17 | |
18 | public final static int PASS_PORTCULLIS_PORT = 0; | |
19 | public final static int PASS_CHEVAL_DE_FRISE_PORT = 0; | |
52ef246c | 20 | public final static int PASS_DRAWBRIDGE_PORT = 0; |
2c9bcd75 CZ |
21 | public final static int PASS_SALLYPORT_PORT = 0; |
22 | ||
23 | public final static int ARCADE_INTAKEARM_LEVEL_ONE_PORT = 0; | |
24 | public final static int ARCADE_INTAKEARM_LEVEL_TWO_PORT = 0; | |
25 | public final static int ARCADE_INTAKEARM_LEVEL_THREE_PORT = 0; | |
26 | public final static int ARCADE_INTAKEARM_LEVEL_FOUR_PORT = 0; | |
27 | ||
28 | public final static int LEFT_JOYSTICK_TRIGGER_PORT = 0; | |
52ef246c KZ |
29 | public final static int SPIN1_PORT = 4; |
30 | public final static int SPIN2_PORT = 5; | |
2c9bcd75 CZ |
31 | public final static int LEFT_JOYSTICK_TOP_CENTER_PORT = 3; |
32 | public final static int LEFT_JOYSTICK_TOP_LOW_PORT = 2; | |
33 | ||
34 | public final static int RIGHT_JOYSTICK_TRIGGER_PORT = 0; | |
35 | public final static int RIGHT_JOYSTICK_THUMB_PORT = 2; | |
36 | ||
52ef246c KZ |
37 | public final static int TOGGLE_SCALING_PORT = 0; |
38 | ||
200caf63 | 39 | } |
38a404b3 | 40 | |
200caf63 KZ |
41 | public static class DriveTrain { |
42 | // Drivetrain Motor Related Ports | |
33141cdd KZ |
43 | public static final int FRONT_LEFT = 1; |
44 | public static final int FRONT_RIGHT = 4; | |
45 | public static final int REAR_LEFT = 2; | |
46 | public static final int REAR_RIGHT = 3; | |
27615e61 | 47 | |
200caf63 | 48 | // Encoder related ports |
33141cdd KZ |
49 | public final static int ENCODER_LEFT_A = 0; |
50 | public final static int ENCODER_LEFT_B = 1; | |
51 | public final static int ENCODER_RIGHT_A = 9; | |
52 | public final static int ENCODER_RIGHT_B = 8; | |
45bdf5b9 | 53 | |
8058ae1c SC |
54 | public final static int FORWARD_CHANNEL = 0; |
55 | public final static int REVERSE_CHANNEL = 0; | |
56 | ||
200caf63 KZ |
57 | private final static double WHEEL_DIAMETER = 6.0; // in inches |
58 | private final static double PULSES_PER_ROTATION = 256; // in pulses | |
59 | private final static double OUTPUT_SPROCKET_DIAMETER = 2.0; // in inches | |
60 | private final static double WHEEL_SPROCKET_DIAMETER = 3.5; // in inches | |
5bc7e25f ME |
61 | public static final double INCHES_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) |
62 | / 256; | |
33141cdd KZ |
63 | |
64 | public static final int MANUAL_MODE = 1, ENCODER_MODE = 2, GYRO_MODE = 3; | |
d9c04720 SC |
65 | public static final int LEFT_FORWARD = 0, LEFT_REVERSE = 1, |
66 | RIGHT_FORWARD = 2, RIGHT_REVERSE = 3; | |
33141cdd | 67 | public static double time = 0; |
2a099bc6 KZ |
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 | ||
54c588d9 CZ |
73 | public static boolean inverted = false; |
74 | ||
200caf63 | 75 | } |
ecf2c4a8 | 76 | |
200caf63 KZ |
77 | public static class Scaler { |
78 | // Piston channels | |
79 | public final static int FORWARD_CHANNEL = 0; | |
cef820ab | 80 | public final static int REVERSE_CHANNEL = 1; |
ecf2c4a8 | 81 | |
200caf63 KZ |
82 | // Winch port |
83 | public final static int WINCH_MOTOR = 0; | |
8b905afe | 84 | |
694c9fc9 | 85 | // Winch speeds |
cef820ab | 86 | public final static double WINCH_STOP_SPEED = 0.0; |
1bfa24f2 | 87 | public final static double WINCH_IN_SPEED = 0; |
39a39f43 | 88 | public final static double SECONDS_TO_CLAMP = 2.0; |
52ef246c KZ |
89 | |
90 | public static boolean SCALING = false; | |
91 | ||
200caf63 | 92 | } |
38a404b3 | 93 | |
200caf63 KZ |
94 | public static class Shooter { |
95 | public static final int PORT = 0; | |
96 | public static final int PUNCH_FORWARD_PORT = 0; | |
97 | public static final int PUNCH_REVERSE_PORT = 1; | |
98 | public static final int ANGLE_ADJUSTER_PORT = 0; | |
2c52cb6e | 99 | |
200caf63 KZ |
100 | public static final DoubleSolenoid.Value punch = DoubleSolenoid.Value.kForward; |
101 | public static final DoubleSolenoid.Value retract = DoubleSolenoid.Value.kReverse; | |
da0c4bd8 | 102 | |
200caf63 KZ |
103 | // Encoder port |
104 | public static final int ENCODER_PORT_A = 0; | |
105 | public static final int ENCODER_PORT_B = 0; | |
2c52cb6e | 106 | |
200caf63 KZ |
107 | public static enum State { |
108 | RUNNING, STOPPED; | |
109 | } | |
110 | } | |
40348cab | 111 | |
585b7a9e ME |
112 | public static class DeadReckoning { |
113 | public static final double DEFAULT_SPEED = 0.5; | |
114 | } | |
115 | ||
200caf63 KZ |
116 | public static class IntakeArm { |
117 | public static final int ROLLER_PORT = 0; | |
118 | public static final int ARM_PORT = 1; | |
119 | public static final int POT_CHANNEL = 0; | |
120 | public static final double INTAKE_SPEED = 0.5; | |
121 | public static final double OUTPUT_SPEED = -0.5; | |
122 | public final static double FULL_RANGE = 270.0; // in degrees | |
123 | public final static double OFFSET = -135.0; // in degrees | |
124 | public static final double ZERO_ANGLE = 0; | |
125 | } | |
29f5cd04 | 126 | |
200caf63 KZ |
127 | public static class DefenseArm { |
128 | // Potentiometer related ports | |
129 | public static final int ARM_CHANNEL = 0; | |
130 | public static final int ARM_PORT = 0; | |
131 | public static final int HAND_PORT = 1; | |
132 | public static final int HAND_CHANNEL = 1; | |
133 | public final static double FULL_RANGE = 270.0; // in degrees | |
134 | public final static double OFFSET = -135.0; // in degrees | |
135 | public final static double[] armPotValue = { 0.0, 45.0, 90.0 }; // 3 | |
136 | // level | |
137 | public final static double ARM_LENGTH = 0; // TODO: find actual length | |
138 | public final static double HAND_LENGTH = 0; // TODO: find actual length | |
139 | public final static double ARM_MOUNTED_HEIGHT = 0; // TODO: find actual | |
140 | // height | |
141 | } | |
1826a8dc | 142 | |
5bc7e25f ME |
143 | public enum Direction { |
144 | UP, DOWN, RIGHT, LEFT, FORWARD, BACKWARD; | |
145 | } | |
146 | ||
200caf63 KZ |
147 | public enum Defense { |
148 | PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHEVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL, RAMPART; | |
149 | } | |
38a404b3 | 150 | } |