2022-01-11 11:05:52 -07:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2021-11-15 16:26:16 -07:00
|
|
|
|
|
|
|
|
package frc4388.robot;
|
|
|
|
|
|
2021-12-06 16:38:29 -07:00
|
|
|
import frc4388.utility.Gains;
|
2021-11-15 16:26:16 -07:00
|
|
|
import frc4388.utility.LEDPatterns;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-01-11 11:49:45 -07:00
|
|
|
* The Constants class provides a convenient place for teams to hold robot-wide
|
|
|
|
|
* numerical or boolean
|
|
|
|
|
* constants. This class should not be used for any other purpose. All constants
|
|
|
|
|
* should be
|
|
|
|
|
* declared globally (i.e. public static). Do not put anything functional in
|
|
|
|
|
* this class.
|
2021-11-15 16:26:16 -07:00
|
|
|
*
|
2022-01-11 11:49:45 -07:00
|
|
|
* <p>
|
|
|
|
|
* It is advised to statically import this class (or one of its inner classes)
|
|
|
|
|
* wherever the
|
2021-11-15 16:26:16 -07:00
|
|
|
* constants are needed, to reduce verbosity.
|
|
|
|
|
*/
|
|
|
|
|
public final class Constants {
|
2022-01-21 17:20:31 -07:00
|
|
|
public static final double TICKS_PER_ROTATION_FX = 2048;
|
|
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
public static final class SwerveDriveConstants {
|
|
|
|
|
public static final double ROTATION_SPEED = 0.1;
|
|
|
|
|
public static final double WHEEL_SPEED = 0.1;
|
|
|
|
|
public static final double WIDTH = 22;
|
|
|
|
|
public static final double HEIGHT = 22;
|
|
|
|
|
public static final double JOYSTICK_TO_METERS_PER_SECOND = 5;
|
|
|
|
|
public static final double MAX_SPEED_FEET_PER_SEC = 16;
|
|
|
|
|
public static final double SPEED_FEET_PER_SECOND_AT_FULL_POWER = 20;
|
|
|
|
|
public static final int LEFT_FRONT_STEER_CAN_ID = 2;
|
|
|
|
|
public static final int LEFT_FRONT_WHEEL_CAN_ID = 3;
|
|
|
|
|
public static final int RIGHT_FRONT_STEER_CAN_ID = 4;
|
|
|
|
|
public static final int RIGHT_FRONT_WHEEL_CAN_ID = 5;
|
|
|
|
|
public static final int LEFT_BACK_STEER_CAN_ID = 6;
|
|
|
|
|
public static final int LEFT_BACK_WHEEL_CAN_ID = 7;
|
|
|
|
|
public static final int RIGHT_BACK_STEER_CAN_ID = 8;
|
|
|
|
|
public static final int RIGHT_BACK_WHEEL_CAN_ID = 9;
|
|
|
|
|
public static final int LEFT_FRONT_STEER_CAN_ENCODER_ID = 10;
|
|
|
|
|
public static final int RIGHT_FRONT_STEER_CAN_ENCODER_ID = 11;
|
|
|
|
|
public static final int LEFT_BACK_STEER_CAN_ENCODER_ID = 12;
|
|
|
|
|
public static final int RIGHT_BACK_STEER_CAN_ENCODER_ID = 13;
|
2022-01-11 11:49:45 -07:00
|
|
|
// ofsets are in degrees
|
2022-01-11 19:57:50 -07:00
|
|
|
//ofsets are in degrees
|
|
|
|
|
// public static final double LEFT_FRONT_ENCODER_OFFSET = 181.494141;
|
|
|
|
|
// public static final double RIGHT_FRONT_ENCODER_OFFSET = 360. - 59.238281;
|
|
|
|
|
// public static final double LEFT_BACK_ENCODER_OFFSET = 360. - 128.144531;
|
|
|
|
|
// public static final double RIGHT_BACK_ENCODER_OFFSET = 0.933594;
|
|
|
|
|
public static final double LEFT_FRONT_ENCODER_OFFSET = 180.0;
|
|
|
|
|
public static final double RIGHT_FRONT_ENCODER_OFFSET = 300.0;
|
|
|
|
|
public static final double LEFT_BACK_ENCODER_OFFSET = 360.0 - 128.0;
|
|
|
|
|
public static final double RIGHT_BACK_ENCODER_OFFSET = 0.0;
|
2022-01-10 19:05:07 -07:00
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
// swerve PID constants
|
|
|
|
|
public static final int SWERVE_SLOT_IDX = 0;
|
|
|
|
|
public static final int SWERVE_PID_LOOP_IDX = 1;
|
|
|
|
|
public static final int SWERVE_TIMEOUT_MS = 30;
|
|
|
|
|
public static final Gains SWERVE_GAINS = new Gains(1.0, 0.0, 0.0, 0.0, 0, 1.0);
|
2022-01-10 19:05:07 -07:00
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
// swerve configuration
|
|
|
|
|
public static final double NEUTRAL_DEADBAND = 0.04;
|
|
|
|
|
public static final double OPEN_LOOP_RAMP_RATE = 0.2;
|
|
|
|
|
public static final int REMOTE_0 = 0;
|
2022-01-11 11:49:45 -07:00
|
|
|
|
|
|
|
|
// misc
|
|
|
|
|
public static final int SMARTDASHBOARD_UPDATE_FRAME = 2;
|
2022-01-11 11:05:52 -07:00
|
|
|
}
|
2022-01-11 11:49:45 -07:00
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
public static final class LEDConstants {
|
|
|
|
|
public static final int LED_SPARK_ID = 0;
|
2021-12-06 16:38:29 -07:00
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
public static final LEDPatterns DEFAULT_PATTERN = LEDPatterns.FOREST_WAVES;
|
|
|
|
|
}
|
2021-12-06 17:45:45 -07:00
|
|
|
|
2022-01-15 13:36:01 -07:00
|
|
|
public static final class ClimberConstants {
|
|
|
|
|
/* TODO: Update motor IDS */
|
2022-01-22 11:25:39 -07:00
|
|
|
public static final int SHOULDER_ID = 1;
|
|
|
|
|
public static final int ELBOW_ID = 3;
|
2022-01-18 20:00:03 -07:00
|
|
|
public static final int GYRO_ID = -1;
|
2022-01-15 15:56:17 -07:00
|
|
|
|
|
|
|
|
// TODO Update this stuff too
|
2022-01-24 17:55:23 -07:00
|
|
|
public static final double UPPER_ARM_LENGTH = 26; // Units should be in cm
|
|
|
|
|
public static final double LOWER_ARM_LENGTH = 27;
|
2022-01-18 20:00:03 -07:00
|
|
|
|
2022-01-24 17:55:23 -07:00
|
|
|
public static final double MAX_ARM_LENGTH = 53;
|
|
|
|
|
public static final double MIN_ARM_LENGTH = 1;
|
2022-01-20 17:10:07 -07:00
|
|
|
|
2022-01-24 17:55:23 -07:00
|
|
|
public static final double MOVE_SPEED = .1; // cm per second
|
2022-01-20 18:13:11 -07:00
|
|
|
|
2022-01-21 17:20:31 -07:00
|
|
|
public static final double SHOULDER_RESTING_ANGLE = 0;
|
|
|
|
|
public static final double ELBOW_RESTING_ANGLE = 0;
|
|
|
|
|
|
2022-01-20 18:13:11 -07:00
|
|
|
// PID Constants
|
|
|
|
|
public static final int SHOULDER_SLOT_IDX = 0;
|
|
|
|
|
public static final int SHOULDER_PID_LOOP_IDX = 1;
|
|
|
|
|
|
|
|
|
|
public static final int ELBOW_SLOT_IDX = 0;
|
|
|
|
|
public static final int ELBOW_PID_LOOP_IDX = 1;
|
|
|
|
|
|
2022-01-24 17:55:23 -07:00
|
|
|
public static final Gains SHOULDER_GAINS = new Gains(.4, 0.0, 0.0, 0.0, 0, 1.0);
|
|
|
|
|
public static final Gains ELBOW_GAINS = new Gains(.4, 0.0, 0.0, 0.0, 0, 1.0);
|
2022-01-20 18:13:11 -07:00
|
|
|
|
2022-01-22 11:25:39 -07:00
|
|
|
public static final int CLIMBER_TIMEOUT_MS = 50;
|
2022-01-15 13:36:01 -07:00
|
|
|
}
|
2022-01-21 17:20:31 -07:00
|
|
|
|
|
|
|
|
public static final class HooksConstants {
|
|
|
|
|
public static final int LEFT_HOOK_ID = -1;
|
|
|
|
|
public static final int RIGHT_HOOK_ID = -1;
|
|
|
|
|
|
|
|
|
|
public static final double OPEN_POSITION = 0;
|
|
|
|
|
public static final double CLOSE_POSITION = 0;
|
|
|
|
|
}
|
2022-01-11 11:49:45 -07:00
|
|
|
/**
|
|
|
|
|
* The OIConstants class contains the ID for the XBox controllers
|
|
|
|
|
*/
|
|
|
|
|
public static final class OIConstants {
|
|
|
|
|
public static final int XBOX_DRIVER_ID = 0;
|
|
|
|
|
public static final int XBOX_OPERATOR_ID = 1;
|
|
|
|
|
}
|
2021-11-15 16:26:16 -07:00
|
|
|
}
|