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;
|
|
|
|
|
|
2022-03-17 13:49:13 -06:00
|
|
|
import java.security.PublicKey;
|
|
|
|
|
|
2022-03-12 11:36:10 -07:00
|
|
|
import com.ctre.phoenix.motorcontrol.StatorCurrentLimitConfiguration;
|
2022-01-20 18:08:05 -07:00
|
|
|
import com.ctre.phoenix.motorcontrol.SupplyCurrentLimitConfiguration;
|
|
|
|
|
|
2022-02-05 10:08:37 -07:00
|
|
|
import edu.wpi.first.math.controller.PIDController;
|
|
|
|
|
import edu.wpi.first.math.controller.ProfiledPIDController;
|
2022-01-20 19:38:58 -07:00
|
|
|
import edu.wpi.first.math.geometry.Pose2d;
|
|
|
|
|
import edu.wpi.first.math.geometry.Rotation2d;
|
|
|
|
|
import edu.wpi.first.math.geometry.Translation2d;
|
2022-02-05 10:08:37 -07:00
|
|
|
import edu.wpi.first.math.trajectory.TrapezoidProfile;
|
2022-03-06 16:05:05 -07:00
|
|
|
import edu.wpi.first.math.util.Units;
|
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-03-19 22:16:20 -06:00
|
|
|
public static final double LOOP_TIME = 0.02;
|
2022-01-21 17:20:31 -07:00
|
|
|
|
2022-01-11 11:05:52 -07:00
|
|
|
public static final class SwerveDriveConstants {
|
2022-03-25 16:14:39 -06:00
|
|
|
public static final double ROTATION_SPEED = 2.3;
|
2022-03-19 16:37:59 -06:00
|
|
|
public static final double WIDTH = 23.75;
|
|
|
|
|
public static final double HEIGHT = 23.75;
|
2022-01-15 14:55:07 -07:00
|
|
|
public static final double JOYSTICK_TO_METERS_PER_SECOND_FAST = 11;
|
|
|
|
|
public static final double JOYSTICK_TO_METERS_PER_SECOND_SLOW = 2;
|
2022-03-06 16:05:05 -07:00
|
|
|
public static final double MAX_SPEED_FEET_PER_SEC = 20; // TODO: redundant constant?
|
|
|
|
|
public static final double SPEED_FEET_PER_SECOND_AT_FULL_POWER = 20; // TODO: redundant constant?
|
2022-03-05 11:12:33 -07:00
|
|
|
|
|
|
|
|
// IDs
|
2022-03-21 22:49:54 -06:00
|
|
|
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-14 17:48:53 -07:00
|
|
|
public static final int GYRO_ID = 14;
|
2022-03-05 11:12:33 -07:00
|
|
|
|
2022-02-28 19:25:07 -07:00
|
|
|
// offsets are in degrees
|
|
|
|
|
// NATHAN if you truncate or round or simplify these i will cry
|
2022-03-05 11:12:33 -07:00
|
|
|
// public static final double LEFT_FRONT_ENCODER_OFFSET = 181.45 - 3.30;//
|
|
|
|
|
// 181.7578125;//180.0;//315.0 +45;//180.0;
|
|
|
|
|
// public static final double RIGHT_FRONT_ENCODER_OFFSET = 360. - 59.0625 +
|
|
|
|
|
// 0.18;// 360.-59.0625;//315.0;//224.296875 +
|
|
|
|
|
// public static final double LEFT_BACK_ENCODER_OFFSET = 360. - 128.222;//
|
|
|
|
|
// 308.408203125;//225.0;//45.87890625;//360.0
|
|
|
|
|
// public static final double RIGHT_BACK_ENCODER_OFFSET = 360. + 2.15 - 3.637;//
|
|
|
|
|
// 180-2.021484375;//0.0;//134.384765625
|
|
|
|
|
|
2022-03-08 16:14:34 -07:00
|
|
|
public static final double LEFT_FRONT_ENCODER_OFFSET = (4 * 360. - 232.58 + 180 ) % 360.;
|
|
|
|
|
public static final double RIGHT_FRONT_ENCODER_OFFSET = (4 * 360. - 152.05 - 180 ) % 360.;
|
|
|
|
|
public static final double LEFT_BACK_ENCODER_OFFSET = (4 * 360. - 189.50) % 360.;
|
|
|
|
|
public static final double RIGHT_BACK_ENCODER_OFFSET = (4 * 360. - 9.31 - 180) % 360.;
|
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;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final Gains SWERVE_GAINS = new Gains(1.5, 0.0, 0.0, 0.0, 0, 1.0);
|
2022-01-10 19:05:07 -07:00
|
|
|
|
2022-02-05 10:08:37 -07:00
|
|
|
// swerve auto constants
|
2022-02-07 19:49:27 -07:00
|
|
|
public static final PIDController X_CONTROLLER = new PIDController(0.5, 0.0, 0.0);
|
|
|
|
|
public static final PIDController Y_CONTROLLER = new PIDController(2.0, 0.0, 0.0);
|
2022-04-04 17:22:52 -06:00
|
|
|
public static final ProfiledPIDController THETA_CONTROLLER = new ProfiledPIDController(15.0, 0, 0.0,//0.1, 0.3,
|
2022-03-21 22:49:54 -06:00
|
|
|
new TrapezoidProfile.Constraints(Math.PI, Math.PI/2));
|
2022-03-01 11:57:49 -07:00
|
|
|
public static final boolean PATH_RECORD_VELOCITY = true;
|
2022-03-01 17:56:55 -07:00
|
|
|
public static final double PATH_MAX_VELOCITY = 5.0;
|
|
|
|
|
public static final double PATH_MAX_ACCELERATION = 5.0;
|
2022-03-01 11:57:49 -07:00
|
|
|
public static final double MIN_WAYPOINT_ANGLE = 20;
|
|
|
|
|
public static final double MIN_WAYPOINT_DISTANCE = 0.1;
|
|
|
|
|
public static final double MIN_WAYPOINT_VELOCITY = 0.1;
|
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
|
|
|
|
2022-01-18 19:53:14 -07:00
|
|
|
// conversions
|
2022-02-19 15:48:39 -07:00
|
|
|
// gear ratio: 5.14 rev motor = 1 rev wheel
|
2022-01-20 19:00:42 -07:00
|
|
|
// wheel diameter: official = 4 in, measured = 3.8 in
|
|
|
|
|
/* Ratio Calculation */
|
2022-02-19 15:48:39 -07:00
|
|
|
public static final double MOTOR_REV_PER_STEER_REV = 12.8;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final double MOTOR_REV_PER_WHEEL_REV = 6.12;// 5.142857;
|
2022-02-05 11:50:49 -07:00
|
|
|
public static final double WHEEL_DIAMETER_INCHES = 4.0;
|
2022-01-20 19:00:42 -07:00
|
|
|
public static final double TICKS_PER_MOTOR_REV = 2048;
|
|
|
|
|
public static final double INCHES_PER_WHEEL_REV = WHEEL_DIAMETER_INCHES * Math.PI;
|
|
|
|
|
public static final double INCHES_PER_METER = 39.370;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final double METERS_PER_INCH = 1 / INCHES_PER_METER;
|
|
|
|
|
public static final double WHEEL_REV_PER_MOTOR_REV = 1 / MOTOR_REV_PER_WHEEL_REV;
|
2022-01-20 19:00:42 -07:00
|
|
|
public static final double TICKS_PER_WHEEL_REV = TICKS_PER_MOTOR_REV * MOTOR_REV_PER_WHEEL_REV;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final double TICKS_PER_INCH = TICKS_PER_WHEEL_REV / INCHES_PER_WHEEL_REV;
|
|
|
|
|
public static final double INCHES_PER_TICK = 1 / TICKS_PER_INCH;
|
2022-01-20 19:00:42 -07:00
|
|
|
public static final double TICK_TIME_TO_SECONDS = 0.1;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final double SECONDS_TO_TICK_TIME = 1 / TICK_TIME_TO_SECONDS;
|
2022-01-18 19:53:14 -07:00
|
|
|
|
2022-03-12 17:32:10 -07:00
|
|
|
// current limits
|
|
|
|
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_STEER = new SupplyCurrentLimitConfiguration(
|
|
|
|
|
false, 10, 0, 0);
|
|
|
|
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_STEER = new StatorCurrentLimitConfiguration(
|
|
|
|
|
false, 15, 0, 0);
|
|
|
|
|
|
|
|
|
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_WHEEL = new SupplyCurrentLimitConfiguration(
|
|
|
|
|
false, 10, 0, 0);
|
|
|
|
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_WHEEL = new StatorCurrentLimitConfiguration(
|
|
|
|
|
false, 15, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
2022-01-11 11:49:45 -07:00
|
|
|
// misc
|
|
|
|
|
public static final int SMARTDASHBOARD_UPDATE_FRAME = 2;
|
2022-01-20 19:38:58 -07:00
|
|
|
public static final Pose2d HUB_POSE = new Pose2d(new Translation2d(0, 0), new Rotation2d(0));
|
2022-03-25 08:34:25 -06:00
|
|
|
|
|
|
|
|
public static final double AUTO_INCHES_PER_SECOND_AT_FULL_POWER = 134.0;
|
2022-01-11 11:05:52 -07:00
|
|
|
}
|
2022-01-11 11:49:45 -07:00
|
|
|
|
2022-01-15 14:20:49 -07:00
|
|
|
public static final class SerializerConstants {
|
2022-03-05 23:03:36 -07:00
|
|
|
public static final double SERIALIZER_BELT_SPEED = 0.1d;
|
2022-01-15 14:20:49 -07:00
|
|
|
|
|
|
|
|
// CAN IDs
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int SERIALIZER_BELT = 17;
|
2022-03-05 15:32:48 -07:00
|
|
|
public static final int SERIALIZER_BELT_BEAM = 27; // TODO
|
2022-01-21 19:00:11 -07:00
|
|
|
}
|
2022-03-05 23:03:36 -07:00
|
|
|
|
2022-01-21 19:00:11 -07:00
|
|
|
public static final class IntakeConstants {
|
|
|
|
|
// CAN IDs
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int INTAKE_MOTOR = 15;
|
|
|
|
|
public static final int EXTENDER_MOTOR = 16;
|
2022-03-12 11:36:10 -07:00
|
|
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_INTAKE = new SupplyCurrentLimitConfiguration(
|
|
|
|
|
false, 10, 0, 0); //Find
|
|
|
|
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_INTAKE = new StatorCurrentLimitConfiguration(
|
|
|
|
|
false, 15, 0, 0);
|
2022-03-14 20:10:12 -06:00
|
|
|
public static final double INTAKE_SPEED_MULTIPLIER = 0.4;
|
2022-01-15 14:20:49 -07:00
|
|
|
}
|
2022-03-14 15:16:21 -06:00
|
|
|
|
|
|
|
|
public static final class ExtenderConstants {
|
2022-04-02 15:28:55 -06:00
|
|
|
public static final double EXTENDER_FORWARD_LIMIT = 200.3;//250.0;
|
2022-03-14 15:16:21 -06:00
|
|
|
public static final double EXTENDER_REVERSE_LIMIT = 0.0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-25 17:58:23 -07:00
|
|
|
public static final class StorageConstants {
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int STORAGE_CAN_ID = 18;
|
2022-03-05 15:32:48 -07:00
|
|
|
public static final int BEAM_SENSOR_SHOOTER = 28; //TODO
|
|
|
|
|
public static final int BEAM_SENSOR_INTAKE = 29; //TODO
|
2022-04-02 15:28:55 -06:00
|
|
|
public static final double STORAGE_SPEED = 1.0;//0.9;
|
2022-01-25 17:58:23 -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 {
|
2022-03-17 17:03:39 -06:00
|
|
|
public static final int SHOULDER_ID = 30;
|
|
|
|
|
public static final int ELBOW_ID = 31;
|
|
|
|
|
public static final int GYRO_ID = 14;
|
2022-03-18 14:09:25 -06:00
|
|
|
|
2022-03-20 21:21:45 -06:00
|
|
|
public static final double INPUT_MULTIPLIER = 1.0;
|
2022-03-18 14:45:27 -06:00
|
|
|
public static final double ELBOW_SOFT_LIMIT_TOLERANCE = 20000.0;
|
|
|
|
|
public static final double SHOULDER_SOFT_LIMIT_TOLERANCE = 12000.0;
|
2022-03-05 14:21:48 -07:00
|
|
|
|
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-03-18 17:37:11 -06:00
|
|
|
public static final double MOVE_SPEED = 30000; // ticks 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-24 19:09:20 -07:00
|
|
|
public static final double SHOULDER_MAX_ANGLE = 135;
|
|
|
|
|
public static final double ELBOW_MAX_ANGLE = 180;
|
|
|
|
|
|
2022-03-16 14:41:27 -06:00
|
|
|
public static final double ELBOW_GB_RATIO = 1.d;
|
|
|
|
|
public static final double SHOULDER_GB_RATIO = 1.d;
|
2022-01-24 19:09:20 -07:00
|
|
|
|
2022-03-18 14:45:27 -06:00
|
|
|
public static final double SHOULDER_FORWARD_SOFT_LIMIT = 53869;
|
|
|
|
|
public static final double SHOULDER_REVERSE_SOFT_LIMIT = 0;
|
|
|
|
|
public static final double ELBOW_FORWARD_SOFT_LIMIT = 281717;
|
|
|
|
|
public static final double ELBOW_REVERSE_SOFT_LIMIT = 0;
|
2022-03-10 17:06:17 -07:00
|
|
|
|
2022-01-20 18:13:11 -07:00
|
|
|
// PID Constants
|
2022-03-18 18:26:10 -06:00
|
|
|
public static final int SHOULDER_POSITION_SLOT_IDX = 0;
|
2022-03-18 23:07:53 -06:00
|
|
|
public static final int SHOULDER_VELOCITY_SLOT_IDX = 0;
|
|
|
|
|
public static final int SHOULDER_PID_LOOP_IDX = 0;
|
2022-01-20 18:13:11 -07:00
|
|
|
|
2022-03-18 18:26:10 -06:00
|
|
|
public static final int ELBOW_POSITION_SLOT_IDX = 0;
|
2022-03-18 23:07:53 -06:00
|
|
|
public static final int ELBOW_VELOCITY_SLOT_IDX = 0;
|
|
|
|
|
public static final int ELBOW_PID_LOOP_IDX = 0;
|
2022-01-20 18:13:11 -07:00
|
|
|
|
2022-03-18 23:07:53 -06:00
|
|
|
public static final Gains SHOULDER_POSITION_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 0.2);
|
|
|
|
|
public static final Gains ELBOW_POSITION_GAINS = new Gains(0.0, 0.0, 0.0, 0.0, 0, 0.2);
|
2022-03-18 18:26:10 -06:00
|
|
|
|
2022-03-18 23:07:53 -06:00
|
|
|
public static final Gains SHOULDER_VELOCITY_GAINS = new Gains(0.2, 0.0, 5.0, 0.0, 0, 0.2);
|
|
|
|
|
public static final Gains ELBOW_VELOCITY_GAINS = new Gains(0.3, 0.005, 5.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-02-22 19:47:31 -07:00
|
|
|
|
2022-03-16 15:46:39 -06:00
|
|
|
public static final double THRESHOLD = 0;
|
|
|
|
|
|
2022-03-05 14:21:48 -07:00
|
|
|
// TODO: Update Constants
|
|
|
|
|
// Robot Angle
|
2022-02-22 19:47:31 -07:00
|
|
|
public static final double ROBOT_ANGLE_ID = 0;
|
|
|
|
|
|
2022-01-15 13:36:01 -07:00
|
|
|
}
|
2022-01-21 17:20:31 -07:00
|
|
|
|
2022-03-05 14:21:48 -07:00
|
|
|
public static final class ClawConstants {
|
|
|
|
|
public static final int LEFT_CLAW_ID = 44;
|
|
|
|
|
public static final int RIGHT_CLAW_ID = 45;
|
2022-01-21 17:20:31 -07:00
|
|
|
|
2022-03-16 14:49:41 -06:00
|
|
|
public static final double OPEN_POSITION = 0; // TODO: find actual position
|
2022-03-16 20:16:32 -06:00
|
|
|
public static final double CLOSE_POSITION = 1; // TODO: find actual position
|
2022-01-28 16:40:49 -07:00
|
|
|
|
2022-03-16 20:16:32 -06:00
|
|
|
public static final double THRESHOLD = .1; // TODO: find actual threshold
|
2022-03-16 14:41:27 -06:00
|
|
|
|
2022-01-28 16:40:49 -07:00
|
|
|
public static final double CALIBRATION_SPEED = 0;
|
2022-03-05 14:38:54 -07:00
|
|
|
|
|
|
|
|
public static final double CURRENT_LIMIT = 0.0; // TODO: set actual current limit;
|
2022-03-16 22:32:57 -06:00
|
|
|
|
|
|
|
|
public static final int TOP_LIMIT = 1800;
|
|
|
|
|
public static final int BOTTOM_LIMIT = 1200;
|
|
|
|
|
|
2022-01-21 17:20:31 -07:00
|
|
|
}
|
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;
|
2022-03-12 19:02:37 -07:00
|
|
|
public static final int BUTTON_BOX_ID = 2;
|
2022-01-31 19:29:00 -07:00
|
|
|
public static final double LEFT_AXIS_DEADBAND = 0.1;
|
|
|
|
|
public static final double RIGHT_AXIS_DEADBAND = 0.6;
|
2022-03-10 16:47:32 -07:00
|
|
|
public static final boolean SKEW_STICKS = true;
|
2022-01-11 11:49:45 -07:00
|
|
|
}
|
2022-01-21 20:58:13 -07:00
|
|
|
|
2022-01-20 18:08:05 -07:00
|
|
|
public static final class ShooterConstants {
|
|
|
|
|
/* PID Constants Shooter */
|
2022-02-09 17:56:22 -07:00
|
|
|
public static final int CLOSED_LOOP_TIME_MS = 1;
|
2022-02-19 11:05:44 -07:00
|
|
|
|
2022-03-01 17:56:55 -07:00
|
|
|
public static final int SHOOTER_TIMEOUT_MS = 32;
|
2022-01-20 18:08:05 -07:00
|
|
|
public static final int SHOOTER_SLOT_IDX = 0;
|
|
|
|
|
public static final int SHOOTER_PID_LOOP_IDX = 1;
|
2022-03-12 11:36:10 -07:00
|
|
|
public static final SupplyCurrentLimitConfiguration SUPPLY_CURRENT_LIMIT_CONFIG_SHOOTER = new SupplyCurrentLimitConfiguration(
|
|
|
|
|
true, 10, 0, 0);
|
|
|
|
|
public static final StatorCurrentLimitConfiguration STATOR_CURRENT_LIMIT_CONFIG_SHOOTER = new StatorCurrentLimitConfiguration(
|
|
|
|
|
true, 27, 0, 0);
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int SHOOTER_FALCON_LEFT_CAN_ID = 21;
|
|
|
|
|
public static final int SHOOTER_FALCON_RIGHT_CAN_ID = 22;
|
2022-03-20 20:18:02 -06:00
|
|
|
public static final double TURRET_SPEED_MULTIPLIER = 0.4;
|
2022-03-16 23:44:20 -06:00
|
|
|
public static final double TURRET_CALIBRATION_MULTIPLIER = 0.5;
|
2022-03-14 16:56:32 -06:00
|
|
|
public static final double TURRET_DEGREES_PER_ROT = 180.0/105.45445251464844;
|
2022-02-28 16:50:55 -07:00
|
|
|
public static final int TURRET_MOTOR_POS_AT_ZERO_ROT = 0;
|
|
|
|
|
public static final int TURRET_MOTOR_ROTS_PER_ROT = 0;
|
|
|
|
|
public static final double ENCODER_TICKS_PER_REV = 2048;
|
2022-03-18 15:09:08 -06:00
|
|
|
public static final double TURRET_CLIMBING_POS = -3.76;
|
2022-03-05 11:12:33 -07:00
|
|
|
|
2022-03-05 11:07:54 -07:00
|
|
|
// Shoot Command Constants
|
2022-03-20 14:25:38 -06:00
|
|
|
public static final Gains TURRET_SHOOT_GAINS = new Gains(3.0, 0.0, 0.0, 0.0, 0, 1.0);
|
2022-03-20 15:24:48 -06:00
|
|
|
public static final Gains SWERVE_SHOOT_GAINS = new Gains(6.0, 0.0, 0.0, 0.0, 0, 1.0);
|
2022-03-05 11:22:35 -07:00
|
|
|
|
2022-01-21 20:56:25 -07:00
|
|
|
/* Turret Constants */
|
2022-03-05 11:12:33 -07:00
|
|
|
// ID
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int TURRET_MOTOR_CAN_ID = 19;
|
2022-03-13 17:02:55 -06:00
|
|
|
//Gains for turret
|
2022-04-04 18:53:38 -06:00
|
|
|
public static final Gains SHOOTER_TURRET_GAINS = new Gains(0.1, 0.0, 0.1, 0.0, 0, 0.6/*TURRET_SPEED_MULTIPLIER*/);
|
|
|
|
|
public static final double SHOOTER_TURRET_MIN = -0.6;//-TURRET_SPEED_MULTIPLIER;
|
2022-03-13 17:02:55 -06:00
|
|
|
//Gains for hood
|
2022-03-08 16:14:34 -07:00
|
|
|
public static final Gains SHOOTER_ANGLE_GAINS = new Gains(0.1, 0.0, 0.0, 0.0, 0, 0.7);
|
2022-01-21 20:56:25 -07:00
|
|
|
|
2022-03-17 11:54:05 -06:00
|
|
|
public static final double TURRET_FORWARD_HARD_LIMIT = 18.429;
|
2022-03-19 21:39:56 -06:00
|
|
|
public static final double TURRET_REVERSE_HARD_LIMIT = -117.8;
|
2022-02-28 16:46:40 -07:00
|
|
|
|
2022-03-17 12:43:54 -06:00
|
|
|
public static final double TURRET_FORWARD_SOFT_LIMIT = TURRET_FORWARD_HARD_LIMIT - 5;
|
2022-03-16 21:18:10 -06:00
|
|
|
public static final double TURRET_REVERSE_SOFT_LIMIT = TURRET_REVERSE_HARD_LIMIT + 2;
|
2022-02-24 19:32:33 -07:00
|
|
|
|
2022-03-17 13:49:13 -06:00
|
|
|
public static final double TURRET_SOFT_LIMIT_TOLERANCE = 20.0;
|
2022-03-13 17:02:55 -06:00
|
|
|
//Shooter gains for actual Drum
|
2022-03-16 15:35:38 -06:00
|
|
|
public static final Gains DRUM_SHOOTER_GAINS = new Gains(0.4, 0.0, 15.0, 0.05, 0, 0);
|
2022-02-28 17:20:01 -07:00
|
|
|
|
2022-01-24 18:48:03 -07:00
|
|
|
/* Hood Constants */
|
2022-03-06 00:48:38 -07:00
|
|
|
public static final int SHOOTER_ANGLE_ADJUST_ID = 20;
|
2022-03-05 11:12:33 -07:00
|
|
|
public static final double HOOD_MOTOR_ROTS_PER_ROT = 1; // TODO: Find
|
|
|
|
|
public static final double HOOD_MOTOR_POS_AT_ZERO_ROT = 0; // TODO: Find
|
2022-03-17 13:49:13 -06:00
|
|
|
public static final double HOOD_FORWARD_SOFT_LIMIT = 0.0; // TODO: find
|
|
|
|
|
public static final double HOOD_REVERSE_SOFT_LIMIT = -150; // TODO: find
|
|
|
|
|
public static final double HOOD_SOFT_LIMIT_TOLERANCE = 20.0;
|
2022-02-28 17:13:13 -07:00
|
|
|
|
2022-01-24 18:48:03 -07:00
|
|
|
}
|
2022-03-05 11:12:33 -07:00
|
|
|
|
2022-01-24 18:48:03 -07:00
|
|
|
public static final class VisionConstants {
|
2022-03-05 11:29:40 -07:00
|
|
|
// public static final double TURN_P_VALUE = 0.8;
|
|
|
|
|
// public static final double X_ANGLE_ERROR = 0.5;
|
|
|
|
|
// public static final double GRAV = 385.83;
|
|
|
|
|
// public static final double TARGET_HEIGHT = 67.5;
|
|
|
|
|
// public static final double FOV = 29.8; //Field of view limelight
|
2022-03-05 10:55:27 -08:00
|
|
|
|
2022-03-13 19:59:55 -06:00
|
|
|
public static final double LIME_ANGLE = 56.4;
|
2022-03-05 11:29:40 -07:00
|
|
|
|
|
|
|
|
public static final String NAME = "photonCamera";
|
|
|
|
|
|
2022-03-06 18:02:04 -07:00
|
|
|
public static final double TARGET_HEIGHT = 8*12 + 8; //TODO: Convert to metric (does this still need to be converted?)
|
2022-03-13 19:59:55 -06:00
|
|
|
public static final double LIME_HEIGHT = 26;
|
2022-03-06 18:02:04 -07:00
|
|
|
public static final double TARGET_RADIUS = 4*12; //TODO: Convert to metric (does this still need to be converted?)
|
2022-03-05 11:29:40 -07:00
|
|
|
public static final double H_FOV = 59.6;
|
2022-03-16 10:32:15 -06:00
|
|
|
public static final double V_FOV = 45.7;
|
2022-03-21 20:00:34 -06:00
|
|
|
public static final double LIME_HIXELS = 640;
|
|
|
|
|
public static final double LIME_VIXELS = 480;
|
2022-03-05 15:22:14 -07:00
|
|
|
public static final double TURRET_kP = 0.1;
|
2022-03-05 11:29:40 -07:00
|
|
|
|
2022-03-16 18:58:58 -06:00
|
|
|
public static final double POINTS_THRESHOLD = 400;
|
|
|
|
|
|
2022-03-05 11:29:40 -07:00
|
|
|
public static final double RANGE = 10;
|
|
|
|
|
|
2022-03-15 14:23:37 -06:00
|
|
|
public static final double EDGE_TO_CENTER = 20;
|
|
|
|
|
public static final double LIMELIGHT_RADIUS = 8;
|
2022-03-05 11:29:40 -07:00
|
|
|
public static final double SHOOTER_CORRECTION = 1.d;
|
2022-01-11 11:49:45 -07:00
|
|
|
}
|
2021-11-15 16:26:16 -07:00
|
|
|
}
|