diff --git a/src/main/deploy/YAGSL/controllerproperties.json b/src/main/deploy/YAGSL/pushbot/controllerproperties.json similarity index 100% rename from src/main/deploy/YAGSL/controllerproperties.json rename to src/main/deploy/YAGSL/pushbot/controllerproperties.json diff --git a/src/main/deploy/YAGSL/modules/backleft.json b/src/main/deploy/YAGSL/pushbot/modules/backleft.json similarity index 100% rename from src/main/deploy/YAGSL/modules/backleft.json rename to src/main/deploy/YAGSL/pushbot/modules/backleft.json diff --git a/src/main/deploy/YAGSL/modules/backright.json b/src/main/deploy/YAGSL/pushbot/modules/backright.json similarity index 100% rename from src/main/deploy/YAGSL/modules/backright.json rename to src/main/deploy/YAGSL/pushbot/modules/backright.json diff --git a/src/main/deploy/YAGSL/modules/frontleft.json b/src/main/deploy/YAGSL/pushbot/modules/frontleft.json similarity index 100% rename from src/main/deploy/YAGSL/modules/frontleft.json rename to src/main/deploy/YAGSL/pushbot/modules/frontleft.json diff --git a/src/main/deploy/YAGSL/modules/frontright.json b/src/main/deploy/YAGSL/pushbot/modules/frontright.json similarity index 100% rename from src/main/deploy/YAGSL/modules/frontright.json rename to src/main/deploy/YAGSL/pushbot/modules/frontright.json diff --git a/src/main/deploy/YAGSL/modules/physicalproperties.json b/src/main/deploy/YAGSL/pushbot/modules/physicalproperties.json similarity index 100% rename from src/main/deploy/YAGSL/modules/physicalproperties.json rename to src/main/deploy/YAGSL/pushbot/modules/physicalproperties.json diff --git a/src/main/deploy/YAGSL/modules/pidfproperties.json b/src/main/deploy/YAGSL/pushbot/modules/pidfproperties.json similarity index 100% rename from src/main/deploy/YAGSL/modules/pidfproperties.json rename to src/main/deploy/YAGSL/pushbot/modules/pidfproperties.json diff --git a/src/main/deploy/YAGSL/swervedrive.json b/src/main/deploy/YAGSL/pushbot/swervedrive.json similarity index 100% rename from src/main/deploy/YAGSL/swervedrive.json rename to src/main/deploy/YAGSL/pushbot/swervedrive.json diff --git a/src/main/deploy/YAGSL/real/controllerproperties.json b/src/main/deploy/YAGSL/real/controllerproperties.json new file mode 100644 index 00000000..669097e7 --- /dev/null +++ b/src/main/deploy/YAGSL/real/controllerproperties.json @@ -0,0 +1,8 @@ +{ + "angleJoystickRadiusDeadband": 0.5, + "heading": { + "p": 0.4, + "i": 0, + "d": 0.01 + } +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/backleft.json b/src/main/deploy/YAGSL/real/modules/backleft.json new file mode 100644 index 00000000..355e4ec8 --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/backleft.json @@ -0,0 +1,27 @@ +{ + "location": { + "front": -9, + "left": 9 + }, + "absoluteEncoderOffset": 0, + "drive": { + "type": "sparkmax_neo", + "id": 58, + "canbus": null + }, + "angle": { + "type": "sparkmax_neo", + "id": 28, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderInverted": false +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/backright.json b/src/main/deploy/YAGSL/real/modules/backright.json new file mode 100644 index 00000000..15eda212 --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/backright.json @@ -0,0 +1,27 @@ +{ + "location": { + "front": -9, + "left": -9 + }, + "absoluteEncoderOffset": 0, + "drive": { + "type": "sparkmax_neo", + "id": 59, + "canbus": null + }, + "angle": { + "type": "sparkmax_neo", + "id": 29, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderInverted": false +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/frontleft.json b/src/main/deploy/YAGSL/real/modules/frontleft.json new file mode 100644 index 00000000..4db82ebd --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/frontleft.json @@ -0,0 +1,27 @@ +{ + "location": { + "front": 9, + "left": 9 + }, + "absoluteEncoderOffset": 0, + "drive": { + "type": "sparkmax_neo", + "id": 57, + "canbus": null + }, + "angle": { + "type": "sparkmax_neo", + "id": 27, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderInverted": false +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/frontright.json b/src/main/deploy/YAGSL/real/modules/frontright.json new file mode 100644 index 00000000..0f459a53 --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/frontright.json @@ -0,0 +1,27 @@ +{ + "location": { + "front": 9, + "left": -9 + }, + "absoluteEncoderOffset": 0, + "drive": { + "type": "sparkmax_neo", + "id": 60, + "canbus": null + }, + "angle": { + "type": "sparkmax_neo", + "id": 30, + "canbus": null + }, + "encoder": { + "type": "cancoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": false, + "angle": false + }, + "absoluteEncoderInverted": false +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/physicalproperties.json b/src/main/deploy/YAGSL/real/modules/physicalproperties.json new file mode 100644 index 00000000..66d5a84c --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/physicalproperties.json @@ -0,0 +1,24 @@ +{ + "optimalVoltage": 12, + "robotMass": 137, + "wheelGripCoefficientOfFriction": 1.19, + "currentLimit": { + "drive": 40, + "angle": 20 + }, + "conversionFactors": { + "angle": { + "gearRatio": 12.8, + "factor": 0 + }, + "drive": { + "diameter": 4, + "gearRatio": 6.75, + "factor": 0 + } + }, + "rampRate": { + "drive": 0.25, + "angle": 0.25 + } +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/modules/pidfproperties.json b/src/main/deploy/YAGSL/real/modules/pidfproperties.json new file mode 100644 index 00000000..3834a362 --- /dev/null +++ b/src/main/deploy/YAGSL/real/modules/pidfproperties.json @@ -0,0 +1,16 @@ +{ + "drive": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0, + "iz": 0 + }, + "angle": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0, + "iz": 0 + } +} \ No newline at end of file diff --git a/src/main/deploy/YAGSL/real/swervedrive.json b/src/main/deploy/YAGSL/real/swervedrive.json new file mode 100644 index 00000000..da972747 --- /dev/null +++ b/src/main/deploy/YAGSL/real/swervedrive.json @@ -0,0 +1,14 @@ +{ + "imu": { + "type": "navx_spi", + "id": 0, + "canbus": null + }, + "invertedIMU": false, + "modules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ] +} \ No newline at end of file diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 484ec2cb..b78621bc 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -134,7 +134,7 @@ public RobotContainer() { SwerveIMU swerveIMU = new ThreadedGyroSwerveIMU(threadedGyro); drivebase = !Constants.TESTBED ? new SwerveSubsystem( - new File(Filesystem.getDeployDirectory(), "YAGSL"), swerveIMU) : null; + new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.JSON_DIRECTORY), swerveIMU) : null; apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createRealIo(), drivebase) : null; } case REPLAY -> { @@ -151,7 +151,7 @@ public RobotContainer() { intakeDeployer = new IntakeDeployerSubsystem(IntakeDeployerSubsystem.createMockIo()); // No GyroSubsystem in REPLAY for now // create the drive subsystem with null gyro (use default json) - drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL"), null) : null; + drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.JSON_DIRECTORY), null) : null; apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createMockIo(), drivebase) : null; } case SIM -> { @@ -170,7 +170,7 @@ public RobotContainer() { intakeDeployer = new IntakeDeployerSubsystem( IntakeDeployerSubsystem.createSimIo(robotVisualizer));// No GyroSubsystem in REPLAY for now // create the drive subsystem with null gyro (use default json) - drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL"), null) : null; + drivebase = !Constants.TESTBED ? new SwerveSubsystem(new File(Filesystem.getDeployDirectory(), "YAGSL/" + Constants.JSON_DIRECTORY), null) : null; apriltagSubsystem = !Constants.TESTBED ? new ApriltagSubsystem(ApriltagSubsystem.createSimIo(), drivebase) : null; } diff --git a/src/main/java/frc/robot/constants/Constants.java b/src/main/java/frc/robot/constants/Constants.java index e0b40bdd..51da79d0 100644 --- a/src/main/java/frc/robot/constants/Constants.java +++ b/src/main/java/frc/robot/constants/Constants.java @@ -14,5 +14,10 @@ * constants are needed, to reduce verbosity. */ -public class Constants extends Constants2026 {} +// To use the other constatns files, change which line is not commented out here. +// Then discard changes to this file before committing. +public class Constants extends ConstantsPushbot2026 { +// public class Constants extends ConstantsReal2026 { +// public class Constants extends ConstantsTestbed2026 { +} \ No newline at end of file diff --git a/src/main/java/frc/robot/constants/Constants2026.java b/src/main/java/frc/robot/constants/ConstantsPushbot2026.java similarity index 84% rename from src/main/java/frc/robot/constants/Constants2026.java rename to src/main/java/frc/robot/constants/ConstantsPushbot2026.java index 44e95cb3..ba94b00e 100644 --- a/src/main/java/frc/robot/constants/Constants2026.java +++ b/src/main/java/frc/robot/constants/ConstantsPushbot2026.java @@ -1,8 +1,8 @@ package frc.robot.constants; -public class Constants2026 extends GameConstants { +public class ConstantsPushbot2026 extends GameConstants { - // Constants2026 is only for CANIDs and nothing else, everything else goes into GameConstants. + // ConstantsPushbot2026 is only for CANIDs and nothing else, everything else goes into GameConstants. public static final int ROLLER_MOTOR_ID = 10; // we dont have a roller this year i thought? public static final int TILT_MOTOR_ID = 20; // we dont have a tilt this year i thought? @@ -33,6 +33,6 @@ public class Constants2026 extends GameConstants { public static final int SERVER_SOCKET_ATTEMPT_DELAY = 100; public static final int TCP_SERVER_PORT = 5806; - + public static final String JSON_DIRECTORY = "pushbot"; } diff --git a/src/main/java/frc/robot/constants/ConstantsReal2026.java b/src/main/java/frc/robot/constants/ConstantsReal2026.java new file mode 100644 index 00000000..627971ac --- /dev/null +++ b/src/main/java/frc/robot/constants/ConstantsReal2026.java @@ -0,0 +1,20 @@ +package frc.robot.constants; + +public class ConstantsReal2026 extends ConstantsPushbot2026 { + + public static final String JSON_DIRECTORY = "real"; + + // shooter related + public static final int SHOOTER_MOTOR_ID = 53; + public static final int SHOOTER_FOLLOWER_MOTOR_ID = 54; + public static final int ANGLER_MOTOR_ID = 11; + + // other CAN-ID's + public static final int TURRET_MOTOR_ID = 1; + public static final int FEEDER_MOTOR_ID = 2; + public static final int HOPPER_MOTOR_ID = 3; + public static final int INTAKE_MOTOR_ID = 4; + public static final int INTAKE_DEPLOYMENT_ID = 5; + public static final int CLIMBER_MOTOR_ID = 6; + +} diff --git a/src/main/java/frc/robot/constants/ConstantsTestbed2026.java b/src/main/java/frc/robot/constants/ConstantsTestbed2026.java index 8fb98737..3865b566 100644 --- a/src/main/java/frc/robot/constants/ConstantsTestbed2026.java +++ b/src/main/java/frc/robot/constants/ConstantsTestbed2026.java @@ -1,19 +1,19 @@ package frc.robot.constants; -public class ConstantsTestbed2026 extends Constants2026 { +/** + * To use the TestBed constants, change Constants.java to read: {@code public class Constants extends + * ConstantsTestbed2026} + * + *
instead of: {@code public class Constants extends ConstantsPushbot2026} + * + *
Then revert changes to Constants.java and ConstantsTestBed.java before committing. + */ +public class ConstantsTestbed2026 extends ConstantsPushbot2026 { // public static final int ROLLER_MOTOR_ID = 40; // public static final int TILT_MOTOR_ID = 42; //Intake motor id (43) isn't real // public static final int HOPPER_MOTOR_ID = 43; - /** - * To use the TestBed constants, change Constants.java to read: public class Constants extends - * ConstantsTestbedClean2025 - * - *
instead of: public class Constants extends Constants2025 - * - *
Then revert changes to Constants.java and ConstantsTestBed.java before committing. - */ /** * This an example of overriding a specific motor ID for testing, no changes to this file should