From e93debefed14fc55f74c4c30f68608415a915b96 Mon Sep 17 00:00:00 2001 From: Samhith Dewal Date: Wed, 21 Jan 2026 20:08:30 -0500 Subject: [PATCH] Sorted the Constants file into two separate files. --- src/main/java/frc/robot/Constants.java | 50 ++------------------ src/main/java/frc/robot/GameConstants.java | 55 ++++++++++++++++++++++ 2 files changed, 58 insertions(+), 47 deletions(-) create mode 100644 src/main/java/frc/robot/GameConstants.java diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 3de451e..b7c24d3 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -4,9 +4,6 @@ package frc.robot; -import edu.wpi.first.math.geometry.Rotation2d; -import edu.wpi.first.wpilibj.RobotBase; - /** * 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 @@ -15,53 +12,12 @@ *

It is advised to statically import this class (or one of its inner classes) wherever the * constants are needed, to reduce verbosity. */ -public final class Constants { - - public enum Mode { - /** - * Running on a real robot. - */ - REAL, - /** - * Running a physics simulator. - */ - SIM, - /** - * Replaying from a log file. - */ - REPLAY - } - - // Mode - public static final Mode simMode = Mode.SIM; - // public static final Mode simMode = Mode.REPLAY; - - public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode; - - public static final int NEO_CURRENT_LIMIT = 20; - - // Logging - public static final long MAX_LOG_TIME_WAIT = 10; - public static final boolean ENABLE_LOGGING = true; - - public static final boolean DEBUG = true; +public final class Constants extends GameConstants{ + public static final int ROLLER_MOTOR_ID = 1; public static final int TILT_MOTOR_ID = 2; public static final int INTAKE_MOTOR_ID = 3; - - public static final double ROLLER_SPEED = 0.25; - public static final double TILT_SPEED = -0.5; // Arm motor is inverted - use negative speed - public static final double INTAKE_SPEED = -0.5; - public static final double SPIN_TIMEOUT = 5; - public static final double TILT_TIMEOUT = 5; - public static final double TILT_LENGTH = 0.2; - public static final Rotation2d TILT_MIN_ANGLE = Rotation2d.fromDegrees(45); - public static final Rotation2d TILT_MAX_ANGLE = Rotation2d.fromDegrees(90); - public static final double TILT_INERTIA = 0.5; - public static final double TILT_GEARING = 45.0; - public static final boolean TILT_SIMULATE_GRAVITY = false; - - public static final boolean ARM_DEBUG = true; + public static final double DRIVE_BASE_WIDTH = 0.635; public static final double DRIVE_BASE_LENGTH = 0.635; public static final double INITIAL_ROBOT_HEIGHT = 0; diff --git a/src/main/java/frc/robot/GameConstants.java b/src/main/java/frc/robot/GameConstants.java new file mode 100644 index 0000000..1c63aaa --- /dev/null +++ b/src/main/java/frc/robot/GameConstants.java @@ -0,0 +1,55 @@ +package frc.robot; + +import edu.wpi.first.math.geometry.Rotation2d; +import edu.wpi.first.wpilibj.RobotBase; + +public class GameConstants { + + public enum Mode { + /** + * Running on a real robot. + */ + REAL, + /** + * Running a physics simulator. + */ + SIM, + /** + * Replaying from a log file. + */ + REPLAY + } + + // Mode + public static final Mode simMode = Mode.SIM; + // public static final Mode simMode = Mode.REPLAY; + public static final Mode currentMode = RobotBase.isReal() ? Mode.REAL : simMode; + + // Logging + public static final long MAX_LOG_TIME_WAIT = 10; + public static final boolean ENABLE_LOGGING = true; + + //Debugs + public static final boolean DEBUG = true; + public static final boolean ARM_DEBUG = true; + + //Speeds + public static final double ROLLER_SPEED = 0.25; + public static final double TILT_SPEED = -0.5; // Arm motor is inverted - use negative speed + public static final double INTAKE_SPEED = -0.5; + + //Timeouts + public static final double SPIN_TIMEOUT = 5; + public static final double TILT_TIMEOUT = 5; + + //Angles + public static final Rotation2d TILT_MIN_ANGLE = Rotation2d.fromDegrees(45); + public static final Rotation2d TILT_MAX_ANGLE = Rotation2d.fromDegrees(90); + + public static final double TILT_LENGTH = 0.2; + public static final double TILT_INERTIA = 0.5; + public static final double TILT_GEARING = 45.0; + public static final boolean TILT_SIMULATE_GRAVITY = false; + public static final int NEO_CURRENT_LIMIT = 20; + +}