3131import edu .wpi .first .wpilibj .XboxController .Button ;
3232import edu .wpi .first .wpilibj2 .command .button .POVButton ;
3333import edu .wpi .first .wpilibj .util .Color ;
34+ import org .carlmontrobotics .subsystems .Led ;
3435
3536/**
3637 * The Constants class provides a convenient place for teams to hold robot-wide
4647 */
4748public final class Constants {
4849 public static final double g = 9.81 ; // meters per second squared
49-
5050 public static final class Led {
51- public static final int ledLength = 1000 ;//lower doesn't work but higher does
52- public static final int ledPort = 5 ;
53-
54- //public static final Color8Bit defaultColor = new Color8Bit(0, 0, 200);
55-
56-
57-
58- public static final Color8Bit detectNote = new Color8Bit (250 ,140 ,3 );
59- public static final Color8Bit holding = new Color8Bit (0 ,250 ,0 );
60- public static final Color8Bit ejectColor = new Color8Bit (250 ,250 ,0 );
61-
62- public static final Color8Bit intakeColor = new Color8Bit (154 ,0 ,255 ); //intake detection = purple
63- public static final Color8Bit outtakeColor = new Color8Bit (0 ,9 ,255 ); //outtake detection = blue
64- public static final Color8Bit intakeouttakeColor = new Color8Bit (0 ,255 ,9 ); //intake and outtake (both) = green
65- //Red when nothing, purple/blue when intake/outtake detect only, green when both
66-
67-
68- //for weird alex stuf
69- public static Color8Bit startingColor = new Color8Bit (255 ,0 ,0 );
70-
51+
52+
53+ public static final Color8Bit DEFAULT_COLOR_BLUE = new Color8Bit (0 , 0 , 200 );
54+ public static final Color8Bit DETECT_NOTE_YELLOW = new Color8Bit (255 ,255 ,0 );
55+ public static final Color8Bit HOLDING_GREEN = new Color8Bit (0 ,250 ,0 );
56+ public static final int ledPort = 0 ;
57+ //TODO: figure out how to get port of LED, it could be 0 or
7158 }
7259
60+
7361 public static final class Effectorc {
7462 // PID values
7563
@@ -222,11 +210,11 @@ public static final class Drivetrainc {
222210 // seconds it takes to go from 0 to 12 volts(aka MAX)
223211 public static final double secsPer12Volts = 0.1 ;
224212
225- // maxRCW is the angular velocity of the robot.
226- // Calculated by looking at one of the motors and treating it as a point mass moving around in a circle.
227- // Tangential speed of this point mass is maxSpeed and the radius of the circle is sqrt((wheelBase/2)^2 + (trackWidth/2)^2)
228- // Angular velocity = Tangential speed / radius
229- public static final double maxRCW = maxSpeed / swerveRadius ;
213+ // maxRCW is the angular velocity of the robot.
214+ // Calculated by looking at one of the motors and treating it as a point mass moving around in a circle.
215+ // Tangential speed of this point mass is maxSpeed and the radius of the circle is sqrt((wheelBase/2)^2 + (trackWidth/2)^2)
216+ // Angular velocity = Tangential speed / radius
217+ public static final double maxRCW = maxSpeed / swerveRadius ;
230218
231219 public static final boolean [] reversed = {false , false , false , false };
232220 // public static final boolean[] reversed = {true, true, true, true};
@@ -267,27 +255,27 @@ public static final class Drivetrainc {
267255 public static final double [] kForwardAccels = {1.1047 /2 , 0.79422 /2 , 0.77114 /2 , 1.1003 /2 };
268256 public static final double [] kBackwardAccels = kForwardAccels ;
269257
270- public static final double autoMaxSpeedMps = 0.35 * 4.4 ; // Meters / second
271- public static final double autoMaxAccelMps2 = mu * g ; // Meters / seconds^2
272- public static final double autoMaxVolt = 10.0 ; // For Drivetrain voltage constraint in RobotPath.java
273- // The maximum acceleration the robot can achieve is equal to the coefficient of static friction times the gravitational acceleration
274- // a = mu * 9.8 m/s^2
275- public static final double autoCentripetalAccel = mu * g * 2 ;
258+ public static final double autoMaxSpeedMps = 0.35 * 4.4 ; // Meters / second
259+ public static final double autoMaxAccelMps2 = mu * g ; // Meters / seconds^2
260+ public static final double autoMaxVolt = 10.0 ; // For Drivetrain voltage constraint in RobotPath.java
261+ // The maximum acceleration the robot can achieve is equal to the coefficient of static friction times the gravitational acceleration
262+ // a = mu * 9.8 m/s^2
263+ public static final double autoCentripetalAccel = mu * g * 2 ;
276264
277- public static final boolean isGyroReversed = true ;
265+ public static final boolean isGyroReversed = true ;
278266
279- // PID values are listed in the order kP, kI, and kD
280- public static final double [] xPIDController = {4 , 0.0 , 0.0 };
281- public static final double [] yPIDController = {4 , 0.0 , 0.0 };
282- public static final double [] thetaPIDController = {0.05 , 0.0 , 0.001 };
267+ // PID values are listed in the order kP, kI, and kD
268+ public static final double [] xPIDController = {4 , 0.0 , 0.0 };
269+ public static final double [] yPIDController = {4 , 0.0 , 0.0 };
270+ public static final double [] thetaPIDController = {0.1 , 0.0 , 0.00 };
283271
284272 public static final SwerveConfig swerveConfig = new SwerveConfig (wheelDiameterMeters , driveGearing , mu , autoCentripetalAccel , kForwardVolts , kForwardVels , kForwardAccels , kBackwardVolts , kBackwardVels , kBackwardAccels , drivekP , drivekI , drivekD , turnkP , turnkI , turnkD , turnkS , turnkV , turnkA , turnZeroDeg , driveInversion , reversed , driveModifier , turnInversion );
285273
286- public static final Transform limelightTransformForPoseEstimation = Transform .BOTPOSE_WPIBLUE ;
274+ // public static final Limelight. Transform limelightTransformForPoseEstimation = Transform.BOTPOSE_WPIBLUE;
287275
288- //#endregion
276+ //#endregion
289277
290- //#region Ports
278+ //#region Ports
291279
292280 public static final int driveFrontLeftPort = 11 ; //
293281 public static final int driveFrontRightPort = 19 ; //
@@ -304,21 +292,21 @@ public static final class Drivetrainc {
304292 public static final int canCoderPortBL = 2 ;
305293 public static final int canCoderPortBR = 1 ;
306294
307- //#endregion
295+ //#endregion
308296
309- //#region Command Constants
297+ //#region Command Constants
310298
311- public static double kNormalDriveSpeed = 1 ; // Percent Multiplier
312- public static double kNormalDriveRotation = 0.5 ; // Percent Multiplier
313- public static double kSlowDriveSpeed = 0.4 ; // Percent Multiplier
314- public static double kSlowDriveRotation = 0.250 ; // Percent Multiplier
315- public static double kAlignMultiplier = 1D /3D ;
316- public static final double kAlignForward = 0.6 ;
299+ public static double kNormalDriveSpeed = 1 ; // Percent Multiplier
300+ public static double kNormalDriveRotation = 0.5 ; // Percent Multiplier
301+ public static double kSlowDriveSpeed = 0.4 ; // Percent Multiplier
302+ public static double kSlowDriveRotation = 0.250 ; // Percent Multiplier
303+ public static double kAlignMultiplier = 1D /3D ;
304+ public static final double kAlignForward = 0.6 ;
317305
318- public static final double wheelTurnDriveSpeed = 0.0001 ; // Meters / Second ; A non-zero speed just used to orient the wheels to the correct angle. This should be very small to avoid actually moving the robot.
306+ public static final double wheelTurnDriveSpeed = 0.0001 ; // Meters / Second ; A non-zero speed just used to orient the wheels to the correct angle. This should be very small to avoid actually moving the robot.
319307
320- public static final double [] positionTolerance = {Units .inchesToMeters (.5 ), Units .inchesToMeters (.5 ), 5 }; // Meters, Meters, Degrees
321- public static final double [] velocityTolerance = {Units .inchesToMeters (1 ), Units .inchesToMeters (1 ), 5 }; // Meters, Meters, Degrees/Second
308+ public static final double [] positionTolerance = {Units .inchesToMeters (.5 ), Units .inchesToMeters (.5 ), 5 }; // Meters, Meters, Degrees
309+ public static final double [] velocityTolerance = {Units .inchesToMeters (1 ), Units .inchesToMeters (1 ), 5 }; // Meters, Meters, Degrees/Second
322310
323311 //#endregion
324312 //#region Subsystem Constants
@@ -341,22 +329,27 @@ public static final class Autoc {
341329 //#endregion
342330 }
343331
344- public static final class Limelight {
332+ public static final class Limelightc {
345333 public static final String INTAKE_LL_NAME = "intake-limelight" ;
346334 public static final String SHOOTER_LL_NAME = "shooter-limelight" ;
347335
348- public static final double ERROR_TOLERANCE = 0.1 ;
349- public static final double HORIZONTAL_FOV_DEG = 0 ;
350- public static final double RESOLUTION_WIDTH = 640 ;
351- public static final double MOUNT_ANGLE_DEG = 46.2 ; //23.228
352- public static final double HEIGHT_FROM_GROUND_METERS = Units .inchesToMeters (9 ); //16.6
353- public static final double ARM_TO_OUTTAKE_OFFSET_DEG = 115 ;
354- public static final class Apriltag {
355- public static final int RED_SPEAKER_CENTER_TAG_ID = 4 ;
356- public static final int BLUE_SPEAKER_CENTER_TAG_ID = 7 ;
357- public static final double SPEAKER_CENTER_HEIGHT_METERS = Units .inchesToMeters (56.7 ); //88.125
358- }
336+ public static final double ERROR_TOLERANCE_RAD = 0.1 ;
337+ public static final double HORIZONTAL_FOV_DEG = 0 ;
338+ public static final double RESOLUTION_WIDTH_PIX = 640 ;
339+ public static final double MOUNT_ANGLE_DEG_SHOOTER = 25 ; //23.228
340+ public static final double MOUNT_ANGLE_DEG_INTAKE = -22 ; //23.228
341+ public static final double HEIGHT_FROM_GROUND_METERS_SHOOTER = Units .inchesToMeters (56 ); //16.6
342+ public static final double HEIGHT_FROM_GROUND_METERS_INTAKE = Units .inchesToMeters (52 ); //16.6
343+ public static final double ARM_TO_OUTTAKE_OFFSET_DEG = 115 ;
344+ public static final double NOTE_HEIGHT = Units .inchesToMeters (0 );
345+ public static final double MIN_MOVEMENT_METERSPSEC = 0.5 ;
346+ public static final double MIN_MOVEMENT_RADSPSEC = 0.5 ;
347+ public static final class Apriltag {
348+ public static final int RED_SPEAKER_CENTER_TAG_ID = 4 ;
349+ public static final int BLUE_SPEAKER_CENTER_TAG_ID = 7 ;
350+ public static final double SPEAKER_CENTER_HEIGHT_METERS = Units .inchesToMeters (56.7 ); //88.125
359351 }
352+ }
360353
361354 public static final class OI {
362355 public static final class Driver {
@@ -397,6 +390,7 @@ public static final class Manipulator {
397390 public static final int RAISE_CLIMBER = Button .kA .value ;
398391 public static final int LOWER_CLIMBER = Button .kY .value ;
399392 }
393+
400394 public static final double JOY_THRESH = 0.01 ;
401395 public static final double MIN_AXIS_TRIGGER_VALUE = 0.2 ;//woah, this is high.
402396 }
0 commit comments