From 29dabbcd95f177097ec91cc371950f5e9efdb899 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 12 Jan 2026 17:30:35 -0500 Subject: [PATCH 001/371] new configs --- simgui.json | 2 + .../deploy/alpha/akit_swerve_drivetrain.json | 164 ++++++++++++++++++ src/main/deploy/alpha/cameras.json | 3 + src/main/deploy/alpha/cameras/intake.json | 13 ++ .../deploy/alpha/cameras/localization.json | 13 ++ src/main/deploy/alpha/cameras/quest.json | 11 ++ src/main/deploy/alpha/cameras/shooter.json | 20 +++ src/main/deploy/alpha/competition_mode.json | 6 + src/main/deploy/alpha/controllers.json | 6 + .../controllers/axis/driver_left_trigger.json | 8 + .../alpha/controllers/axis/driver_left_x.json | 8 + .../alpha/controllers/axis/driver_left_y.json | 8 + .../axis/driver_right_trigger.json | 8 + .../controllers/axis/driver_right_x.json | 8 + .../controllers/axis/operator_left_y.json | 9 + .../controllers/axis/operator_right_y.json | 9 + src/main/deploy/alpha/controllers/driver.json | 11 ++ .../deploy/alpha/controllers/operator.json | 8 + src/main/deploy/alpha/demo_mode.json | 6 + .../deploy/alpha/drive_modules/backleft.json | 5 + .../deploy/alpha/drive_modules/backright.json | 5 + .../deploy/alpha/drive_modules/frontleft.json | 5 + .../alpha/drive_modules/frontright.json | 5 + src/main/deploy/alpha/field/game_pieces.json | 10 ++ src/main/deploy/alpha/robot.json | 16 ++ .../deploy/alpha/subsystems/led_strip.json | 16 ++ src/main/deploy/alpha/yagsl_drivetrain.json | 24 +++ .../yagsl_swerve/controllerproperties.json | 8 + .../alpha/yagsl_swerve/modules/backleft.json | 26 +++ .../alpha/yagsl_swerve/modules/backright.json | 26 +++ .../alpha/yagsl_swerve/modules/frontleft.json | 26 +++ .../yagsl_swerve/modules/frontright.json | 26 +++ .../modules/physicalproperties.json | 24 +++ .../yagsl_swerve/modules/pidfproperties.json | 16 ++ .../alpha/yagsl_swerve/swervedrive.json | 14 ++ src/main/deploy/robots.json | 12 +- .../tigershark/akit_swerve_drivetrain.json | 164 ++++++++++++++++++ src/main/deploy/tigershark/cameras.json | 3 + .../deploy/tigershark/cameras/intake.json | 13 ++ .../tigershark/cameras/localization.json | 13 ++ src/main/deploy/tigershark/cameras/quest.json | 11 ++ .../deploy/tigershark/cameras/shooter.json | 20 +++ .../deploy/tigershark/competition_mode.json | 6 + src/main/deploy/tigershark/controllers.json | 6 + .../controllers/axis/driver_left_trigger.json | 8 + .../controllers/axis/driver_left_x.json | 8 + .../controllers/axis/driver_left_y.json | 8 + .../axis/driver_right_trigger.json | 8 + .../controllers/axis/driver_right_x.json | 8 + .../controllers/axis/operator_left_y.json | 9 + .../controllers/axis/operator_right_y.json | 9 + .../deploy/tigershark/controllers/driver.json | 11 ++ .../tigershark/controllers/operator.json | 8 + src/main/deploy/tigershark/demo_mode.json | 6 + .../tigershark/drive_modules/backleft.json | 5 + .../tigershark/drive_modules/backright.json | 5 + .../tigershark/drive_modules/frontleft.json | 5 + .../tigershark/drive_modules/frontright.json | 5 + .../deploy/tigershark/field/game_pieces.json | 10 ++ src/main/deploy/tigershark/robot.json | 16 ++ .../tigershark/subsystems/led_strip.json | 16 ++ .../deploy/tigershark/yagsl_drivetrain.json | 24 +++ .../yagsl_swerve/controllerproperties.json | 8 + .../yagsl_swerve/modules/backleft.json | 26 +++ .../yagsl_swerve/modules/backright.json | 26 +++ .../yagsl_swerve/modules/frontleft.json | 26 +++ .../yagsl_swerve/modules/frontright.json | 26 +++ .../modules/physicalproperties.json | 24 +++ .../yagsl_swerve/modules/pidfproperties.json | 16 ++ .../tigershark/yagsl_swerve/swervedrive.json | 14 ++ src/main/java/frc/robot/BuildConstants.java | 14 +- src/main/java/frc/robot/alpha/Alpha.java | 38 ++++ .../java/frc/robot/tigershark/TigerShark.java | 38 ++++ 73 files changed, 1238 insertions(+), 8 deletions(-) create mode 100644 src/main/deploy/alpha/akit_swerve_drivetrain.json create mode 100644 src/main/deploy/alpha/cameras.json create mode 100644 src/main/deploy/alpha/cameras/intake.json create mode 100644 src/main/deploy/alpha/cameras/localization.json create mode 100644 src/main/deploy/alpha/cameras/quest.json create mode 100644 src/main/deploy/alpha/cameras/shooter.json create mode 100644 src/main/deploy/alpha/competition_mode.json create mode 100644 src/main/deploy/alpha/controllers.json create mode 100644 src/main/deploy/alpha/controllers/axis/driver_left_trigger.json create mode 100644 src/main/deploy/alpha/controllers/axis/driver_left_x.json create mode 100644 src/main/deploy/alpha/controllers/axis/driver_left_y.json create mode 100644 src/main/deploy/alpha/controllers/axis/driver_right_trigger.json create mode 100644 src/main/deploy/alpha/controllers/axis/driver_right_x.json create mode 100644 src/main/deploy/alpha/controllers/axis/operator_left_y.json create mode 100644 src/main/deploy/alpha/controllers/axis/operator_right_y.json create mode 100644 src/main/deploy/alpha/controllers/driver.json create mode 100644 src/main/deploy/alpha/controllers/operator.json create mode 100644 src/main/deploy/alpha/demo_mode.json create mode 100644 src/main/deploy/alpha/drive_modules/backleft.json create mode 100644 src/main/deploy/alpha/drive_modules/backright.json create mode 100644 src/main/deploy/alpha/drive_modules/frontleft.json create mode 100644 src/main/deploy/alpha/drive_modules/frontright.json create mode 100644 src/main/deploy/alpha/field/game_pieces.json create mode 100644 src/main/deploy/alpha/robot.json create mode 100644 src/main/deploy/alpha/subsystems/led_strip.json create mode 100644 src/main/deploy/alpha/yagsl_drivetrain.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/controllerproperties.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/backleft.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/backright.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/frontright.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json create mode 100644 src/main/deploy/alpha/yagsl_swerve/swervedrive.json create mode 100644 src/main/deploy/tigershark/akit_swerve_drivetrain.json create mode 100644 src/main/deploy/tigershark/cameras.json create mode 100644 src/main/deploy/tigershark/cameras/intake.json create mode 100644 src/main/deploy/tigershark/cameras/localization.json create mode 100644 src/main/deploy/tigershark/cameras/quest.json create mode 100644 src/main/deploy/tigershark/cameras/shooter.json create mode 100644 src/main/deploy/tigershark/competition_mode.json create mode 100644 src/main/deploy/tigershark/controllers.json create mode 100644 src/main/deploy/tigershark/controllers/axis/driver_left_trigger.json create mode 100644 src/main/deploy/tigershark/controllers/axis/driver_left_x.json create mode 100644 src/main/deploy/tigershark/controllers/axis/driver_left_y.json create mode 100644 src/main/deploy/tigershark/controllers/axis/driver_right_trigger.json create mode 100644 src/main/deploy/tigershark/controllers/axis/driver_right_x.json create mode 100644 src/main/deploy/tigershark/controllers/axis/operator_left_y.json create mode 100644 src/main/deploy/tigershark/controllers/axis/operator_right_y.json create mode 100644 src/main/deploy/tigershark/controllers/driver.json create mode 100644 src/main/deploy/tigershark/controllers/operator.json create mode 100644 src/main/deploy/tigershark/demo_mode.json create mode 100644 src/main/deploy/tigershark/drive_modules/backleft.json create mode 100644 src/main/deploy/tigershark/drive_modules/backright.json create mode 100644 src/main/deploy/tigershark/drive_modules/frontleft.json create mode 100644 src/main/deploy/tigershark/drive_modules/frontright.json create mode 100644 src/main/deploy/tigershark/field/game_pieces.json create mode 100644 src/main/deploy/tigershark/robot.json create mode 100644 src/main/deploy/tigershark/subsystems/led_strip.json create mode 100644 src/main/deploy/tigershark/yagsl_drivetrain.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/controllerproperties.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/backleft.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/backright.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/frontleft.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/frontright.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/physicalproperties.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/modules/pidfproperties.json create mode 100644 src/main/deploy/tigershark/yagsl_swerve/swervedrive.json create mode 100644 src/main/java/frc/robot/alpha/Alpha.java create mode 100644 src/main/java/frc/robot/tigershark/TigerShark.java diff --git a/simgui.json b/simgui.json index 943b4072..318bb4c6 100644 --- a/simgui.json +++ b/simgui.json @@ -91,6 +91,7 @@ "/Shuffleboard/BabySwerve/Auto Modes": "String Chooser", "/Shuffleboard/ExampleRobot/Auto Modes": "String Chooser", "/SmartDashboard/Alerts": "Alerts", + "/SmartDashboard/Alpha/Auto Modes": "String Chooser", "/SmartDashboard/Arm/mechanism": "Mechanism2d", "/SmartDashboard/Auto Modes": "String Chooser", "/SmartDashboard/Drive Visual": "Mechanism2d", @@ -115,6 +116,7 @@ "/SmartDashboard/SendableChooser[0]": "String Chooser", "/SmartDashboard/Shooter/mechanism": "Mechanism2d", "/SmartDashboard/Swerve Drive": "Alerts", + "/SmartDashboard/TigerShark/Auto Modes": "String Chooser", "/SmartDashboard/Turret/mechanism": "Mechanism2d", "/SmartDashboard/VisionSystemSim-Vision/Sim Field": "Field2d", "/SmartDashboard/VisionSystemSim-main/Sim Field": "Field2d", diff --git a/src/main/deploy/alpha/akit_swerve_drivetrain.json b/src/main/deploy/alpha/akit_swerve_drivetrain.json new file mode 100644 index 00000000..9ca7d62d --- /dev/null +++ b/src/main/deploy/alpha/akit_swerve_drivetrain.json @@ -0,0 +1,164 @@ +{ + "type": "TalonFX", + "constants": { + "trackWidth": { + "val": 28, + "uom": "inches" + }, + "wheelBase": { + "val": 28, + "uom": "inches" + }, + "wheelDiameter": { + "val": 4, + "uom": "inches" + }, + "maxDriveSpeed": { + "val": 4.69, + "uom": "m/sec" + }, + "bumperFrameLength": { + "val": 38, + "uom": "inches" + }, + "bumperFrameWidth": { + "val": 38, + "uom": "inches" + }, + "gyro": { + "type": "pigeon2", + "id": 13, + "inverted": false, + "canbus": "canivore" + }, + "driveGearRatio": "1:7.363636363636365", + "steerGearRatio": "1:15.42857142857143", + "driveMotorControl": { + "feedBack": { + "p": 0.1, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.2, + "v": 0.124, + "a": 0.0 + } + }, + "steerMotorControl": { + "feedBack": { + "p": 100, + "i": 0.0, + "d": 0.5 + }, + "feedForward": { + "s": 0.1, + "v": 1.91, + "a": 0.0 + } + }, + "modules": { + "frontLeft": { + "driveMotorSetup": { + "name": "frontLeftDrive", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 1 + }, + "steerMotorSetup": { + "name": "frontLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 2 + }, + "encoderId": 0, + "absoluteOffset": { + "val": 0.15234375, + "uom": "rotations" + }, + "encoderInverted": false + }, + "frontRight": { + "driveMotorSetup": { + "name": "frontRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 3 + }, + "steerMotorSetup": { + "name": "frontRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 4 + }, + "encoderId": 1, + "absoluteOffset": { + "val": -0.4873046875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backLeft": { + "driveMotorSetup": { + "name": "backLeftDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 5 + }, + "steerMotorSetup": { + "name": "backLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 6 + }, + "encoderId": 2, + "absoluteOffset": { + "val": -0.219482421875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backRight": { + "driveMotorSetup": { + "name": "backRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 7 + }, + "steerMotorSetup": { + "name": "backRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 8 + }, + "encoderId": 3, + "absoluteOffset": { + "val": 0.17236328125, + "uom": "rotations" + }, + "encoderInverted": false + } + }, + "coupleRatio": 3.8181818181818183, + "invertLeftSide": true, + "invertRightSide": true, + "steerInertia": { + "val": 0.04, + "uom": "kg*m^2" + }, + "driveInertia": { + "val": 0.025, + "uom": "kg*m^2" + }, + "robotMass": { + "val": 50, + "uom": "kg" + }, + "wheelCOF": 1.2, + "slipCurrent": { + "val": 120, + "uom": "amps" + }, + "canbus": "canivore" + } +} diff --git a/src/main/deploy/alpha/cameras.json b/src/main/deploy/alpha/cameras.json new file mode 100644 index 00000000..bfdc48b6 --- /dev/null +++ b/src/main/deploy/alpha/cameras.json @@ -0,0 +1,3 @@ +{ + "cameras": [] +} diff --git a/src/main/deploy/alpha/cameras/intake.json b/src/main/deploy/alpha/cameras/intake.json new file mode 100644 index 00000000..33938add --- /dev/null +++ b/src/main/deploy/alpha/cameras/intake.json @@ -0,0 +1,13 @@ +{ + "name": "intake", + "use": "target", + "type": "limelight", + "column": 0, + "x": 0.15, + "y": 0.05, + "z": 0.2, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetHeight": 0.02 +} diff --git a/src/main/deploy/alpha/cameras/localization.json b/src/main/deploy/alpha/cameras/localization.json new file mode 100644 index 00000000..706b561a --- /dev/null +++ b/src/main/deploy/alpha/cameras/localization.json @@ -0,0 +1,13 @@ +{ + "name": "localization", + "use": "apriltag", + "type": "limelight", + "strategy": "LOWEST_AMBIGUITY", + "column": 0, + "x": -0.35, + "y": -0.25, + "z": 0.5, + "roll": 0, + "pitch": -20, + "yaw": 180 +} diff --git a/src/main/deploy/alpha/cameras/quest.json b/src/main/deploy/alpha/cameras/quest.json new file mode 100644 index 00000000..df412311 --- /dev/null +++ b/src/main/deploy/alpha/cameras/quest.json @@ -0,0 +1,11 @@ +{ + "name": "quest", + "use": "quest", + "column": 0, + "x": 0, + "y": 0, + "z": 18, + "roll": 0, + "pitch": 0, + "yaw": 0 +} diff --git a/src/main/deploy/alpha/cameras/shooter.json b/src/main/deploy/alpha/cameras/shooter.json new file mode 100644 index 00000000..9cf3bb35 --- /dev/null +++ b/src/main/deploy/alpha/cameras/shooter.json @@ -0,0 +1,20 @@ +{ + "name": "shooter", + "use": "target", + "type": "photonvision", + "column": 0, + "x": 0.25, + "y": 0, + "z": 0.25, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetFiducialIds": [ + 17, + 18, + 19, + 20, + 21, + 22 + ] +} diff --git a/src/main/deploy/alpha/competition_mode.json b/src/main/deploy/alpha/competition_mode.json new file mode 100644 index 00000000..f67b949b --- /dev/null +++ b/src/main/deploy/alpha/competition_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 6.0, + "maxAngularSpeed": 6.0, + "maxAccelleration": 3.0, + "maxAngularAccelleration": 18.75 +} diff --git a/src/main/deploy/alpha/controllers.json b/src/main/deploy/alpha/controllers.json new file mode 100644 index 00000000..c6c86acb --- /dev/null +++ b/src/main/deploy/alpha/controllers.json @@ -0,0 +1,6 @@ +{ + "controllers": [ + "driver.json", + "operator.json" + ] +} diff --git a/src/main/deploy/alpha/controllers/axis/driver_left_trigger.json b/src/main/deploy/alpha/controllers/axis/driver_left_trigger.json new file mode 100644 index 00000000..41b79133 --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/driver_left_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 2, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/driver_left_x.json b/src/main/deploy/alpha/controllers/axis/driver_left_x.json new file mode 100644 index 00000000..d77f0e91 --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/driver_left_x.json @@ -0,0 +1,8 @@ +{ + "channel": 0, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/driver_left_y.json b/src/main/deploy/alpha/controllers/axis/driver_left_y.json new file mode 100644 index 00000000..d826731e --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/driver_left_y.json @@ -0,0 +1,8 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/driver_right_trigger.json b/src/main/deploy/alpha/controllers/axis/driver_right_trigger.json new file mode 100644 index 00000000..47b46917 --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/driver_right_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 3, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/driver_right_x.json b/src/main/deploy/alpha/controllers/axis/driver_right_x.json new file mode 100644 index 00000000..8f981e23 --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/driver_right_x.json @@ -0,0 +1,8 @@ +{ + "channel": 4, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/operator_left_y.json b/src/main/deploy/alpha/controllers/axis/operator_left_y.json new file mode 100644 index 00000000..c13bd0e0 --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/operator_left_y.json @@ -0,0 +1,9 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/axis/operator_right_y.json b/src/main/deploy/alpha/controllers/axis/operator_right_y.json new file mode 100644 index 00000000..2668956f --- /dev/null +++ b/src/main/deploy/alpha/controllers/axis/operator_right_y.json @@ -0,0 +1,9 @@ +{ + "channel": 5, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/alpha/controllers/driver.json b/src/main/deploy/alpha/controllers/driver.json new file mode 100644 index 00000000..e2dbc76a --- /dev/null +++ b/src/main/deploy/alpha/controllers/driver.json @@ -0,0 +1,11 @@ +{ + "name": "driver", + "port": 0, + "axis": [ + "driver_left_y.json", + "driver_left_x.json", + "driver_right_x.json", + "driver_left_trigger.json", + "driver_right_trigger.json" + ] +} diff --git a/src/main/deploy/alpha/controllers/operator.json b/src/main/deploy/alpha/controllers/operator.json new file mode 100644 index 00000000..858cfea8 --- /dev/null +++ b/src/main/deploy/alpha/controllers/operator.json @@ -0,0 +1,8 @@ +{ + "name": "operator", + "port": 1, + "axis": [ + "operator_left_y.json", + "operator_right_y.json" + ] +} diff --git a/src/main/deploy/alpha/demo_mode.json b/src/main/deploy/alpha/demo_mode.json new file mode 100644 index 00000000..f60f73c9 --- /dev/null +++ b/src/main/deploy/alpha/demo_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 2.0, + "maxAngularSpeed": 2.0, + "maxAccelleration": 1.0, + "maxAngularAccelleration": 9.0 +} diff --git a/src/main/deploy/alpha/drive_modules/backleft.json b/src/main/deploy/alpha/drive_modules/backleft.json new file mode 100644 index 00000000..c62ce932 --- /dev/null +++ b/src/main/deploy/alpha/drive_modules/backleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.19542, + "v": 2.2924, + "a": 0.35934 +} diff --git a/src/main/deploy/alpha/drive_modules/backright.json b/src/main/deploy/alpha/drive_modules/backright.json new file mode 100644 index 00000000..aee7fd95 --- /dev/null +++ b/src/main/deploy/alpha/drive_modules/backright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18096, + "v": 2.2915, + "a": 0.37156 +} diff --git a/src/main/deploy/alpha/drive_modules/frontleft.json b/src/main/deploy/alpha/drive_modules/frontleft.json new file mode 100644 index 00000000..bdf7d3fa --- /dev/null +++ b/src/main/deploy/alpha/drive_modules/frontleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.21848, + "v": 2.3118, + "a": 0.20314 +} diff --git a/src/main/deploy/alpha/drive_modules/frontright.json b/src/main/deploy/alpha/drive_modules/frontright.json new file mode 100644 index 00000000..36a1c209 --- /dev/null +++ b/src/main/deploy/alpha/drive_modules/frontright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18434, + "v": 2.3018, + "a": 0.30992 +} diff --git a/src/main/deploy/alpha/field/game_pieces.json b/src/main/deploy/alpha/field/game_pieces.json new file mode 100644 index 00000000..b13b37c1 --- /dev/null +++ b/src/main/deploy/alpha/field/game_pieces.json @@ -0,0 +1,10 @@ +{ + "gamePieces": [ + { + "x": 2, + "y": 7, + "type": "Coral", + "rotation": 0 + } + ] +} diff --git a/src/main/deploy/alpha/robot.json b/src/main/deploy/alpha/robot.json new file mode 100644 index 00000000..ddde0045 --- /dev/null +++ b/src/main/deploy/alpha/robot.json @@ -0,0 +1,16 @@ +{ + "userConfig": "competition_mode.json", + "driveType": "YAGSL_SWERVE_DRIVE", + "trackWidth": 16.8, + "trackWidthUom": "in", + "wheelBase": 18.5, + "wheelBaseUom": "in", + "wheelDiameter": 0.103386904, + "wheelDiameterUom": "m", + "physicalMaxSpeed": 5.93, + "physicalMaxSpeedUom": "m/s", + "driveMotorGearRatio": 1.0, + "loadSimulatedField": true, + "gamePieceA": "Coral", + "gamePieceB": "Algae" +} diff --git a/src/main/deploy/alpha/subsystems/led_strip.json b/src/main/deploy/alpha/subsystems/led_strip.json new file mode 100644 index 00000000..25c307af --- /dev/null +++ b/src/main/deploy/alpha/subsystems/led_strip.json @@ -0,0 +1,16 @@ +{ + "length": 30, + "dataPin": 0, + "segments": [ + { + "name": "status_indicator", + "start": 0, + "end": 9 + }, + { + "name": "team_colors", + "start": 10, + "end": 29 + } + ] +} diff --git a/src/main/deploy/alpha/yagsl_drivetrain.json b/src/main/deploy/alpha/yagsl_drivetrain.json new file mode 100644 index 00000000..c6beb5d7 --- /dev/null +++ b/src/main/deploy/alpha/yagsl_drivetrain.json @@ -0,0 +1,24 @@ +{ + "directory": "basic_robot/yagsl_swerve", + "turningMotorGearRatio": 1.0, + "driveModules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ], + "startingPose": { + "x": { + "val": 1.0, + "uom": "m" + }, + "y": { + "val": 1.0, + "uom": "m" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/controllerproperties.json b/src/main/deploy/alpha/yagsl_swerve/controllerproperties.json new file mode 100644 index 00000000..dd353caf --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/controllerproperties.json @@ -0,0 +1,8 @@ +{ + "angleJoystickRadiusDeadband": 0.05, + "heading": { + "p": 0.4, + "i": 0, + "d": 0.01 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json b/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json new file mode 100644 index 00000000..2ac2a1ab --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 17, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 6, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/backright.json b/src/main/deploy/alpha/yagsl_swerve/modules/backright.json new file mode 100644 index 00000000..eea317b8 --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/backright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 18, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 2, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json b/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json new file mode 100644 index 00000000..1c03c3f1 --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 15, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 4, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json b/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json new file mode 100644 index 00000000..6218565f --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 16, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 3, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json b/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json new file mode 100644 index 00000000..c921b000 --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json @@ -0,0 +1,24 @@ +{ + "conversionFactors": { + "angle": { + "gearRatio": 12.8, + "factor": 0 + }, + "drive": { + "gearRatio": 8.14, + "diameter": 4, + "factor": 0 + } + }, + "currentLimit": { + "drive": 100, + "angle": 20 + }, + "rampRate": { + "drive": 0.15, + "angle": 0.05 + }, + "wheelGripCoefficientOfFriction": 1.19, + "optimalVoltage": 12, + "robotMass": 75 +} diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json b/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json new file mode 100644 index 00000000..5924fdbb --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json @@ -0,0 +1,16 @@ +{ + "drive": { + "p": 0.00023, + "i": 0.0000002, + "d": 1, + "f": 0, + "iz": 0 + }, + "angle": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0.001, + "iz": 0 + } +} diff --git a/src/main/deploy/alpha/yagsl_swerve/swervedrive.json b/src/main/deploy/alpha/yagsl_swerve/swervedrive.json new file mode 100644 index 00000000..f4876233 --- /dev/null +++ b/src/main/deploy/alpha/yagsl_swerve/swervedrive.json @@ -0,0 +1,14 @@ +{ + "imu": { + "type": "pigeon2", + "id": 13, + "canbus": "" + }, + "invertedIMU": false, + "modules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ] +} diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index 50eac16d..a362b920 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -4,12 +4,22 @@ "basic_robot": { "id": "basic_robot", "robotClass": "frc.robot.example.ExampleRobot", + "simulate": false + }, + "tigershark": { + "id": "tigershark", + "robotClass": "frc.robot.tigershark.TigerShark", + "simulate": false + }, + "alpha": { + "id": "alpha", + "robotClass": "frc.robot.alpha.Alpha", "simulate": true }, "baby_swerve": { "id": "00:80:2F:24:6D:74", "robotClass": "frc.robot.baby_swerve.BabySwerve", - "simulate": true, + "simulate": false, "competition": true } } diff --git a/src/main/deploy/tigershark/akit_swerve_drivetrain.json b/src/main/deploy/tigershark/akit_swerve_drivetrain.json new file mode 100644 index 00000000..9ca7d62d --- /dev/null +++ b/src/main/deploy/tigershark/akit_swerve_drivetrain.json @@ -0,0 +1,164 @@ +{ + "type": "TalonFX", + "constants": { + "trackWidth": { + "val": 28, + "uom": "inches" + }, + "wheelBase": { + "val": 28, + "uom": "inches" + }, + "wheelDiameter": { + "val": 4, + "uom": "inches" + }, + "maxDriveSpeed": { + "val": 4.69, + "uom": "m/sec" + }, + "bumperFrameLength": { + "val": 38, + "uom": "inches" + }, + "bumperFrameWidth": { + "val": 38, + "uom": "inches" + }, + "gyro": { + "type": "pigeon2", + "id": 13, + "inverted": false, + "canbus": "canivore" + }, + "driveGearRatio": "1:7.363636363636365", + "steerGearRatio": "1:15.42857142857143", + "driveMotorControl": { + "feedBack": { + "p": 0.1, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.2, + "v": 0.124, + "a": 0.0 + } + }, + "steerMotorControl": { + "feedBack": { + "p": 100, + "i": 0.0, + "d": 0.5 + }, + "feedForward": { + "s": 0.1, + "v": 1.91, + "a": 0.0 + } + }, + "modules": { + "frontLeft": { + "driveMotorSetup": { + "name": "frontLeftDrive", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 1 + }, + "steerMotorSetup": { + "name": "frontLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 2 + }, + "encoderId": 0, + "absoluteOffset": { + "val": 0.15234375, + "uom": "rotations" + }, + "encoderInverted": false + }, + "frontRight": { + "driveMotorSetup": { + "name": "frontRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 3 + }, + "steerMotorSetup": { + "name": "frontRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 4 + }, + "encoderId": 1, + "absoluteOffset": { + "val": -0.4873046875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backLeft": { + "driveMotorSetup": { + "name": "backLeftDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 5 + }, + "steerMotorSetup": { + "name": "backLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 6 + }, + "encoderId": 2, + "absoluteOffset": { + "val": -0.219482421875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backRight": { + "driveMotorSetup": { + "name": "backRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 7 + }, + "steerMotorSetup": { + "name": "backRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 8 + }, + "encoderId": 3, + "absoluteOffset": { + "val": 0.17236328125, + "uom": "rotations" + }, + "encoderInverted": false + } + }, + "coupleRatio": 3.8181818181818183, + "invertLeftSide": true, + "invertRightSide": true, + "steerInertia": { + "val": 0.04, + "uom": "kg*m^2" + }, + "driveInertia": { + "val": 0.025, + "uom": "kg*m^2" + }, + "robotMass": { + "val": 50, + "uom": "kg" + }, + "wheelCOF": 1.2, + "slipCurrent": { + "val": 120, + "uom": "amps" + }, + "canbus": "canivore" + } +} diff --git a/src/main/deploy/tigershark/cameras.json b/src/main/deploy/tigershark/cameras.json new file mode 100644 index 00000000..bfdc48b6 --- /dev/null +++ b/src/main/deploy/tigershark/cameras.json @@ -0,0 +1,3 @@ +{ + "cameras": [] +} diff --git a/src/main/deploy/tigershark/cameras/intake.json b/src/main/deploy/tigershark/cameras/intake.json new file mode 100644 index 00000000..33938add --- /dev/null +++ b/src/main/deploy/tigershark/cameras/intake.json @@ -0,0 +1,13 @@ +{ + "name": "intake", + "use": "target", + "type": "limelight", + "column": 0, + "x": 0.15, + "y": 0.05, + "z": 0.2, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetHeight": 0.02 +} diff --git a/src/main/deploy/tigershark/cameras/localization.json b/src/main/deploy/tigershark/cameras/localization.json new file mode 100644 index 00000000..706b561a --- /dev/null +++ b/src/main/deploy/tigershark/cameras/localization.json @@ -0,0 +1,13 @@ +{ + "name": "localization", + "use": "apriltag", + "type": "limelight", + "strategy": "LOWEST_AMBIGUITY", + "column": 0, + "x": -0.35, + "y": -0.25, + "z": 0.5, + "roll": 0, + "pitch": -20, + "yaw": 180 +} diff --git a/src/main/deploy/tigershark/cameras/quest.json b/src/main/deploy/tigershark/cameras/quest.json new file mode 100644 index 00000000..df412311 --- /dev/null +++ b/src/main/deploy/tigershark/cameras/quest.json @@ -0,0 +1,11 @@ +{ + "name": "quest", + "use": "quest", + "column": 0, + "x": 0, + "y": 0, + "z": 18, + "roll": 0, + "pitch": 0, + "yaw": 0 +} diff --git a/src/main/deploy/tigershark/cameras/shooter.json b/src/main/deploy/tigershark/cameras/shooter.json new file mode 100644 index 00000000..9cf3bb35 --- /dev/null +++ b/src/main/deploy/tigershark/cameras/shooter.json @@ -0,0 +1,20 @@ +{ + "name": "shooter", + "use": "target", + "type": "photonvision", + "column": 0, + "x": 0.25, + "y": 0, + "z": 0.25, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetFiducialIds": [ + 17, + 18, + 19, + 20, + 21, + 22 + ] +} diff --git a/src/main/deploy/tigershark/competition_mode.json b/src/main/deploy/tigershark/competition_mode.json new file mode 100644 index 00000000..f67b949b --- /dev/null +++ b/src/main/deploy/tigershark/competition_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 6.0, + "maxAngularSpeed": 6.0, + "maxAccelleration": 3.0, + "maxAngularAccelleration": 18.75 +} diff --git a/src/main/deploy/tigershark/controllers.json b/src/main/deploy/tigershark/controllers.json new file mode 100644 index 00000000..c6c86acb --- /dev/null +++ b/src/main/deploy/tigershark/controllers.json @@ -0,0 +1,6 @@ +{ + "controllers": [ + "driver.json", + "operator.json" + ] +} diff --git a/src/main/deploy/tigershark/controllers/axis/driver_left_trigger.json b/src/main/deploy/tigershark/controllers/axis/driver_left_trigger.json new file mode 100644 index 00000000..41b79133 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/driver_left_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 2, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/driver_left_x.json b/src/main/deploy/tigershark/controllers/axis/driver_left_x.json new file mode 100644 index 00000000..d77f0e91 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/driver_left_x.json @@ -0,0 +1,8 @@ +{ + "channel": 0, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/driver_left_y.json b/src/main/deploy/tigershark/controllers/axis/driver_left_y.json new file mode 100644 index 00000000..d826731e --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/driver_left_y.json @@ -0,0 +1,8 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/driver_right_trigger.json b/src/main/deploy/tigershark/controllers/axis/driver_right_trigger.json new file mode 100644 index 00000000..47b46917 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/driver_right_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 3, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/driver_right_x.json b/src/main/deploy/tigershark/controllers/axis/driver_right_x.json new file mode 100644 index 00000000..8f981e23 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/driver_right_x.json @@ -0,0 +1,8 @@ +{ + "channel": 4, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/operator_left_y.json b/src/main/deploy/tigershark/controllers/axis/operator_left_y.json new file mode 100644 index 00000000..c13bd0e0 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/operator_left_y.json @@ -0,0 +1,9 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/axis/operator_right_y.json b/src/main/deploy/tigershark/controllers/axis/operator_right_y.json new file mode 100644 index 00000000..2668956f --- /dev/null +++ b/src/main/deploy/tigershark/controllers/axis/operator_right_y.json @@ -0,0 +1,9 @@ +{ + "channel": 5, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/tigershark/controllers/driver.json b/src/main/deploy/tigershark/controllers/driver.json new file mode 100644 index 00000000..e2dbc76a --- /dev/null +++ b/src/main/deploy/tigershark/controllers/driver.json @@ -0,0 +1,11 @@ +{ + "name": "driver", + "port": 0, + "axis": [ + "driver_left_y.json", + "driver_left_x.json", + "driver_right_x.json", + "driver_left_trigger.json", + "driver_right_trigger.json" + ] +} diff --git a/src/main/deploy/tigershark/controllers/operator.json b/src/main/deploy/tigershark/controllers/operator.json new file mode 100644 index 00000000..858cfea8 --- /dev/null +++ b/src/main/deploy/tigershark/controllers/operator.json @@ -0,0 +1,8 @@ +{ + "name": "operator", + "port": 1, + "axis": [ + "operator_left_y.json", + "operator_right_y.json" + ] +} diff --git a/src/main/deploy/tigershark/demo_mode.json b/src/main/deploy/tigershark/demo_mode.json new file mode 100644 index 00000000..f60f73c9 --- /dev/null +++ b/src/main/deploy/tigershark/demo_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 2.0, + "maxAngularSpeed": 2.0, + "maxAccelleration": 1.0, + "maxAngularAccelleration": 9.0 +} diff --git a/src/main/deploy/tigershark/drive_modules/backleft.json b/src/main/deploy/tigershark/drive_modules/backleft.json new file mode 100644 index 00000000..c62ce932 --- /dev/null +++ b/src/main/deploy/tigershark/drive_modules/backleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.19542, + "v": 2.2924, + "a": 0.35934 +} diff --git a/src/main/deploy/tigershark/drive_modules/backright.json b/src/main/deploy/tigershark/drive_modules/backright.json new file mode 100644 index 00000000..aee7fd95 --- /dev/null +++ b/src/main/deploy/tigershark/drive_modules/backright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18096, + "v": 2.2915, + "a": 0.37156 +} diff --git a/src/main/deploy/tigershark/drive_modules/frontleft.json b/src/main/deploy/tigershark/drive_modules/frontleft.json new file mode 100644 index 00000000..bdf7d3fa --- /dev/null +++ b/src/main/deploy/tigershark/drive_modules/frontleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.21848, + "v": 2.3118, + "a": 0.20314 +} diff --git a/src/main/deploy/tigershark/drive_modules/frontright.json b/src/main/deploy/tigershark/drive_modules/frontright.json new file mode 100644 index 00000000..36a1c209 --- /dev/null +++ b/src/main/deploy/tigershark/drive_modules/frontright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18434, + "v": 2.3018, + "a": 0.30992 +} diff --git a/src/main/deploy/tigershark/field/game_pieces.json b/src/main/deploy/tigershark/field/game_pieces.json new file mode 100644 index 00000000..b13b37c1 --- /dev/null +++ b/src/main/deploy/tigershark/field/game_pieces.json @@ -0,0 +1,10 @@ +{ + "gamePieces": [ + { + "x": 2, + "y": 7, + "type": "Coral", + "rotation": 0 + } + ] +} diff --git a/src/main/deploy/tigershark/robot.json b/src/main/deploy/tigershark/robot.json new file mode 100644 index 00000000..0a20f3e5 --- /dev/null +++ b/src/main/deploy/tigershark/robot.json @@ -0,0 +1,16 @@ +{ + "userConfig": "competition_mode.json", + "driveType": "AKIT_SWERVE_DRIVE", + "trackWidth": 16.8, + "trackWidthUom": "in", + "wheelBase": 18.5, + "wheelBaseUom": "in", + "wheelDiameter": 0.103386904, + "wheelDiameterUom": "m", + "physicalMaxSpeed": 5.93, + "physicalMaxSpeedUom": "m/s", + "driveMotorGearRatio": 1.0, + "loadSimulatedField": true, + "gamePieceA": "Coral", + "gamePieceB": "Algae" +} diff --git a/src/main/deploy/tigershark/subsystems/led_strip.json b/src/main/deploy/tigershark/subsystems/led_strip.json new file mode 100644 index 00000000..25c307af --- /dev/null +++ b/src/main/deploy/tigershark/subsystems/led_strip.json @@ -0,0 +1,16 @@ +{ + "length": 30, + "dataPin": 0, + "segments": [ + { + "name": "status_indicator", + "start": 0, + "end": 9 + }, + { + "name": "team_colors", + "start": 10, + "end": 29 + } + ] +} diff --git a/src/main/deploy/tigershark/yagsl_drivetrain.json b/src/main/deploy/tigershark/yagsl_drivetrain.json new file mode 100644 index 00000000..c6beb5d7 --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_drivetrain.json @@ -0,0 +1,24 @@ +{ + "directory": "basic_robot/yagsl_swerve", + "turningMotorGearRatio": 1.0, + "driveModules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ], + "startingPose": { + "x": { + "val": 1.0, + "uom": "m" + }, + "y": { + "val": 1.0, + "uom": "m" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/controllerproperties.json b/src/main/deploy/tigershark/yagsl_swerve/controllerproperties.json new file mode 100644 index 00000000..dd353caf --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/controllerproperties.json @@ -0,0 +1,8 @@ +{ + "angleJoystickRadiusDeadband": 0.05, + "heading": { + "p": 0.4, + "i": 0, + "d": 0.01 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/backleft.json b/src/main/deploy/tigershark/yagsl_swerve/modules/backleft.json new file mode 100644 index 00000000..2ac2a1ab --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/backleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 17, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 6, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/backright.json b/src/main/deploy/tigershark/yagsl_swerve/modules/backright.json new file mode 100644 index 00000000..eea317b8 --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/backright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 18, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 2, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/frontleft.json b/src/main/deploy/tigershark/yagsl_swerve/modules/frontleft.json new file mode 100644 index 00000000..1c03c3f1 --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/frontleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 15, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 4, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/frontright.json b/src/main/deploy/tigershark/yagsl_swerve/modules/frontright.json new file mode 100644 index 00000000..6218565f --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/frontright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 16, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 3, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/physicalproperties.json b/src/main/deploy/tigershark/yagsl_swerve/modules/physicalproperties.json new file mode 100644 index 00000000..c921b000 --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/physicalproperties.json @@ -0,0 +1,24 @@ +{ + "conversionFactors": { + "angle": { + "gearRatio": 12.8, + "factor": 0 + }, + "drive": { + "gearRatio": 8.14, + "diameter": 4, + "factor": 0 + } + }, + "currentLimit": { + "drive": 100, + "angle": 20 + }, + "rampRate": { + "drive": 0.15, + "angle": 0.05 + }, + "wheelGripCoefficientOfFriction": 1.19, + "optimalVoltage": 12, + "robotMass": 75 +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/modules/pidfproperties.json b/src/main/deploy/tigershark/yagsl_swerve/modules/pidfproperties.json new file mode 100644 index 00000000..5924fdbb --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/modules/pidfproperties.json @@ -0,0 +1,16 @@ +{ + "drive": { + "p": 0.00023, + "i": 0.0000002, + "d": 1, + "f": 0, + "iz": 0 + }, + "angle": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0.001, + "iz": 0 + } +} diff --git a/src/main/deploy/tigershark/yagsl_swerve/swervedrive.json b/src/main/deploy/tigershark/yagsl_swerve/swervedrive.json new file mode 100644 index 00000000..f4876233 --- /dev/null +++ b/src/main/deploy/tigershark/yagsl_swerve/swervedrive.json @@ -0,0 +1,14 @@ +{ + "imu": { + "type": "pigeon2", + "id": 13, + "canbus": "" + }, + "invertedIMU": false, + "modules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ] +} diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 69769cda..4424a470 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "FRC5010Example"; + public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 63; - public static final String GIT_SHA = "5793fc65d4ddb3e2c77f28797052b21386f6ed12"; - public static final String GIT_DATE = "2026-01-10 10:18:27 EST"; - public static final String GIT_BRANCH = "beta"; - public static final String BUILD_DATE = "2026-01-10 11:28:29 EST"; - public static final long BUILD_UNIX_TIME = 1768062509191L; + public static final int GIT_REVISION = 70; + public static final String GIT_SHA = "e45534465a38994eaa52227ce3e1edce0b243dbf"; + public static final String GIT_DATE = "2026-01-11 17:13:03 EST"; + public static final String GIT_BRANCH = "Rebuilt"; + public static final String BUILD_DATE = "2026-01-12 17:29:15 EST"; + public static final long BUILD_UNIX_TIME = 1768256955900L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/alpha/Alpha.java b/src/main/java/frc/robot/alpha/Alpha.java new file mode 100644 index 00000000..3e450bfd --- /dev/null +++ b/src/main/java/frc/robot/alpha/Alpha.java @@ -0,0 +1,38 @@ +package frc.robot.alpha; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.example.DisplayValueSubsystem; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; + +public class Alpha extends GenericRobot { + SwerveConstants swerveConstants; + GenericDrivetrain drivetrain; + DisplayValueSubsystem displayValueSubsystem = new DisplayValueSubsystem(); + + public Alpha(String directory) { + super(directory); + drivetrain = (GenericDrivetrain) getSubsystem(ConfigConstants.DRIVETRAIN); + } + + @Override + public void configureButtonBindings(Controller driver, Controller operator) {} + + @Override + public void setupDefaultCommands(Controller driver, Controller operator) { + drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); + } + + @Override + public void initAutoCommands() { + drivetrain.setAutoBuilder(); + } + + @Override + public Command generateAutoCommand(Command autoCommand) { + return drivetrain.generateAutoCommand(autoCommand); + } +} diff --git a/src/main/java/frc/robot/tigershark/TigerShark.java b/src/main/java/frc/robot/tigershark/TigerShark.java new file mode 100644 index 00000000..fb5be9b3 --- /dev/null +++ b/src/main/java/frc/robot/tigershark/TigerShark.java @@ -0,0 +1,38 @@ +package frc.robot.tigershark; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.example.DisplayValueSubsystem; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; + +public class TigerShark extends GenericRobot { + SwerveConstants swerveConstants; + GenericDrivetrain drivetrain; + DisplayValueSubsystem displayValueSubsystem = new DisplayValueSubsystem(); + + public TigerShark(String directory) { + super(directory); + drivetrain = (GenericDrivetrain) getSubsystem(ConfigConstants.DRIVETRAIN); + } + + @Override + public void configureButtonBindings(Controller driver, Controller operator) {} + + @Override + public void setupDefaultCommands(Controller driver, Controller operator) { + drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); + } + + @Override + public void initAutoCommands() { + drivetrain.setAutoBuilder(); + } + + @Override + public Command generateAutoCommand(Command autoCommand) { + return drivetrain.generateAutoCommand(autoCommand); + } +} From 8b87cd0ab2655c8d8ebf7a4d847a27e6b0092fd0 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 12 Jan 2026 19:01:42 -0500 Subject: [PATCH 002/371] Working State --- simgui.json | 10 ++--- src/main/deploy/robots.json | 10 ++--- .../tigershark/akit_swerve_drivetrain.json | 44 +++++++++---------- src/main/java/frc/robot/BuildConstants.java | 10 ++--- .../java/frc/robot/tigershark/TigerShark.java | 8 ++++ .../drive/swerve/akit/GyroIOPigeon2.java | 5 ++- 6 files changed, 48 insertions(+), 39 deletions(-) diff --git a/simgui.json b/simgui.json index 318bb4c6..1c8b767f 100644 --- a/simgui.json +++ b/simgui.json @@ -665,11 +665,6 @@ "visible": true } }, - "/SmartDashboard/ExampleRobot/Auto Modes": { - "window": { - "visible": true - } - }, "/SmartDashboard/Field": { "OdometryPose": { "arrowColor": [ @@ -710,6 +705,11 @@ "visible": true } }, + "/SmartDashboard/TigerShark/Auto Modes": { + "window": { + "visible": true + } + }, "/SmartDashboard/VisionSystemSim-main/Sim Field": { "bottom": 1638, "height": 8.051901817321777, diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index a362b920..011f9cb9 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -7,20 +7,20 @@ "simulate": false }, "tigershark": { - "id": "tigershark", + "id": "00:80:2F:38:90:61", "robotClass": "frc.robot.tigershark.TigerShark", - "simulate": false + "simulate": true, + "competition": true }, "alpha": { "id": "alpha", "robotClass": "frc.robot.alpha.Alpha", - "simulate": true + "simulate": false }, "baby_swerve": { "id": "00:80:2F:24:6D:74", "robotClass": "frc.robot.baby_swerve.BabySwerve", - "simulate": false, - "competition": true + "simulate": false } } } diff --git a/src/main/deploy/tigershark/akit_swerve_drivetrain.json b/src/main/deploy/tigershark/akit_swerve_drivetrain.json index 9ca7d62d..4f295f3a 100644 --- a/src/main/deploy/tigershark/akit_swerve_drivetrain.json +++ b/src/main/deploy/tigershark/akit_swerve_drivetrain.json @@ -2,15 +2,15 @@ "type": "TalonFX", "constants": { "trackWidth": { - "val": 28, + "val": 22, "uom": "inches" }, "wheelBase": { - "val": 28, + "val": 22, "uom": "inches" }, "wheelDiameter": { - "val": 4, + "val": 3.955, "uom": "inches" }, "maxDriveSpeed": { @@ -18,21 +18,21 @@ "uom": "m/sec" }, "bumperFrameLength": { - "val": 38, + "val": 30, "uom": "inches" }, "bumperFrameWidth": { - "val": 38, + "val": 30, "uom": "inches" }, "gyro": { "type": "pigeon2", - "id": 13, + "id": 50, "inverted": false, - "canbus": "canivore" + "canbus": "" }, - "driveGearRatio": "1:7.363636363636365", - "steerGearRatio": "1:15.42857142857143", + "driveGearRatio": "1:6.75", + "steerGearRatio": "1:25", "driveMotorControl": { "feedBack": { "p": 0.1, @@ -63,15 +63,15 @@ "name": "frontLeftDrive", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 1 + "canId": 4 }, "steerMotorSetup": { "name": "frontLeftSteer", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 2 + "canId": 3 }, - "encoderId": 0, + "encoderId": 13, "absoluteOffset": { "val": 0.15234375, "uom": "rotations" @@ -83,15 +83,15 @@ "name": "frontRightDrive", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 3 + "canId": 2 }, "steerMotorSetup": { "name": "frontRightSteer", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 4 + "canId": 1 }, - "encoderId": 1, + "encoderId": 16, "absoluteOffset": { "val": -0.4873046875, "uom": "rotations" @@ -103,15 +103,15 @@ "name": "backLeftDrive", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 5 + "canId": 6 }, "steerMotorSetup": { "name": "backLeftSteer", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 6 + "canId": 5 }, - "encoderId": 2, + "encoderId": 14, "absoluteOffset": { "val": -0.219482421875, "uom": "rotations" @@ -123,15 +123,15 @@ "name": "backRightDrive", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 7 + "canId": 8 }, "steerMotorSetup": { "name": "backRightSteer", "controllerType": "talonfx", "motorType": "Krakenx60", - "canId": 8 + "canId": 7 }, - "encoderId": 3, + "encoderId": 15, "absoluteOffset": { "val": 0.17236328125, "uom": "rotations" @@ -159,6 +159,6 @@ "val": 120, "uom": "amps" }, - "canbus": "canivore" + "canbus": "" } } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 4424a470..df9477d2 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 70; - public static final String GIT_SHA = "e45534465a38994eaa52227ce3e1edce0b243dbf"; - public static final String GIT_DATE = "2026-01-11 17:13:03 EST"; + public static final int GIT_REVISION = 71; + public static final String GIT_SHA = "29dabbcd95f177097ec91cc371950f5e9efdb899"; + public static final String GIT_DATE = "2026-01-12 17:30:35 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-12 17:29:15 EST"; - public static final long BUILD_UNIX_TIME = 1768256955900L; + public static final String BUILD_DATE = "2026-01-12 18:54:29 EST"; + public static final long BUILD_UNIX_TIME = 1768262069859L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/tigershark/TigerShark.java b/src/main/java/frc/robot/tigershark/TigerShark.java index fb5be9b3..f3253a74 100644 --- a/src/main/java/frc/robot/tigershark/TigerShark.java +++ b/src/main/java/frc/robot/tigershark/TigerShark.java @@ -1,6 +1,7 @@ package frc.robot.tigershark; import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.example.DisplayValueSubsystem; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; @@ -35,4 +36,11 @@ public void initAutoCommands() { public Command generateAutoCommand(Command autoCommand) { return drivetrain.generateAutoCommand(autoCommand); } + + @Override + public void buildAutoCommands() { + super.buildAutoCommands(); + selectableCommand.addOption("Do Nothing", Commands.none()); + drivetrain.addAutoCommands(selectableCommand); + } } diff --git a/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java b/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java index 1280b55c..72064e47 100644 --- a/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java +++ b/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java @@ -36,10 +36,11 @@ public GyroIOPigeon2(AkitSwerveConfig config) { yaw.setUpdateFrequency(config.ODOMETRY_FREQUENCY); yawVelocity.setUpdateFrequency(50.0); pigeon.optimizeBusUtilization(); - yawTimestampQueue = OdometryThread.getInstance().makeTimestampQueue(); + yawTimestampQueue = PhoenixOdometryThread.getInstance().makeTimestampQueue(); var yawClone = yaw.clone(); // Status signals are not thread-safe yawPositionQueue = - OdometryThread.getInstance().registerSignal(() -> yawClone.refresh().getValueAsDouble()); + PhoenixOdometryThread.getInstance() + .registerSignal(() -> yawClone.refresh().getValueAsDouble()); } @Override From d9e92fd03cb42dc7882fc7ccf2ff551c5979a28d Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 14 Jan 2026 17:09:19 -0500 Subject: [PATCH 003/371] indexer indexer --- src/main/deploy/tigershark/subsystems/indexer.json | 0 src/main/deploy/tigershark/subsystems/indexer/feeder.json | 0 src/main/deploy/tigershark/subsystems/indexer/indexer.json | 0 src/main/java/frc/robot/Launcher/Launcher.java | 0 src/main/java/frc/robot/subsystems/indexer.java | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/deploy/tigershark/subsystems/indexer.json create mode 100644 src/main/deploy/tigershark/subsystems/indexer/feeder.json create mode 100644 src/main/deploy/tigershark/subsystems/indexer/indexer.json create mode 100644 src/main/java/frc/robot/Launcher/Launcher.java create mode 100644 src/main/java/frc/robot/subsystems/indexer.java diff --git a/src/main/deploy/tigershark/subsystems/indexer.json b/src/main/deploy/tigershark/subsystems/indexer.json new file mode 100644 index 00000000..e69de29b diff --git a/src/main/deploy/tigershark/subsystems/indexer/feeder.json b/src/main/deploy/tigershark/subsystems/indexer/feeder.json new file mode 100644 index 00000000..e69de29b diff --git a/src/main/deploy/tigershark/subsystems/indexer/indexer.json b/src/main/deploy/tigershark/subsystems/indexer/indexer.json new file mode 100644 index 00000000..e69de29b diff --git a/src/main/java/frc/robot/Launcher/Launcher.java b/src/main/java/frc/robot/Launcher/Launcher.java new file mode 100644 index 00000000..e69de29b diff --git a/src/main/java/frc/robot/subsystems/indexer.java b/src/main/java/frc/robot/subsystems/indexer.java new file mode 100644 index 00000000..e69de29b From ad2e6421394993bd46684293b021d90f551944be Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 17:09:28 -0500 Subject: [PATCH 004/371] Created Launcher subsystem and related .json files Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- .../tigershark/subsystems/launcher.json | 5 ++ .../tigershark/subsystems/launcher/hood.json | 64 +++++++++++++++++++ .../subsystems/launcher/shooter.json | 48 ++++++++++++++ .../subsystems/launcher/turret.json | 57 +++++++++++++++++ .../java/frc/robot/subsystems/Launcher.java | 7 ++ 5 files changed, 181 insertions(+) create mode 100644 src/main/deploy/tigershark/subsystems/launcher.json create mode 100644 src/main/deploy/tigershark/subsystems/launcher/hood.json create mode 100644 src/main/deploy/tigershark/subsystems/launcher/shooter.json create mode 100644 src/main/deploy/tigershark/subsystems/launcher/turret.json create mode 100644 src/main/java/frc/robot/subsystems/Launcher.java diff --git a/src/main/deploy/tigershark/subsystems/launcher.json b/src/main/deploy/tigershark/subsystems/launcher.json new file mode 100644 index 00000000..489170ae --- /dev/null +++ b/src/main/deploy/tigershark/subsystems/launcher.json @@ -0,0 +1,5 @@ +{ + "shooter": "launcher/shooter.json", + "hood": "launcher/hood.json", + "turret": "launcher/turret.json" +} \ No newline at end of file diff --git a/src/main/deploy/tigershark/subsystems/launcher/hood.json b/src/main/deploy/tigershark/subsystems/launcher/hood.json new file mode 100644 index 00000000..38cf9e27 --- /dev/null +++ b/src/main/deploy/tigershark/subsystems/launcher/hood.json @@ -0,0 +1,64 @@ +{ + "motorSetup": { + "name": "Arm", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 11 + }, + "motorSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "length": { + "val": 0.135, + "uom": "in" + }, + "lowerHardLimit": { + "val": -80, + "uom": "deg" + }, + "upperHardLimit": { + "val": 200, + "uom": "deg" + }, + "startingAngle": { + "val": 0, + "uom": "deg" + }, + "lowerSoftLimit": { + "val": -30, + "uom": "deg" + }, + "upperSoftLimit": { + "val": 100, + "uom": "deg" + }, + "gearing": [ + 3, + 4 + ], + "mass": { + "val": 1, + "uom": "lbs" + }, + "horizontalZero": { + "val": 0, + "uom": "deg" + } +} diff --git a/src/main/deploy/tigershark/subsystems/launcher/shooter.json b/src/main/deploy/tigershark/subsystems/launcher/shooter.json new file mode 100644 index 00000000..876b65fc --- /dev/null +++ b/src/main/deploy/tigershark/subsystems/launcher/shooter.json @@ -0,0 +1,48 @@ +{ + "motorSetup": { + "name": "Shooter", + "controllerType": "spark", + "motorType": "Neo", + "canId": 12 + }, + "motorSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "lowerSoftLimit": { + "val": 0, + "uom": "rpm" + }, + "upperSoftLimit": { + "val": 5000, + "uom": "rpm" + }, + "gearing": [ + 3, + 4 + ], + "mass": { + "val": 2, + "uom": "kg" + }, + "diameter": { + "val": 0.05, + "uom": "m" + } +} diff --git a/src/main/deploy/tigershark/subsystems/launcher/turret.json b/src/main/deploy/tigershark/subsystems/launcher/turret.json new file mode 100644 index 00000000..329453e1 --- /dev/null +++ b/src/main/deploy/tigershark/subsystems/launcher/turret.json @@ -0,0 +1,57 @@ +{ + "motorSetup": { + "name": "Turret", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 12 + }, + "motorSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "lowerHardLimit": { + "val": -100, + "uom": "deg" + }, + "upperHardLimit": { + "val": 200, + "uom": "deg" + }, + "startingAngle": { + "val": 0, + "uom": "deg" + }, + "lowerSoftLimit": { + "val": -30, + "uom": "deg" + }, + "upperSoftLimit": { + "val": 100, + "uom": "deg" + }, + "gearing": [ + 3, + 4 + ], + "startingPosition": { + "val": 0, + "uom": "deg" + }, + "moi": 0.001 +} diff --git a/src/main/java/frc/robot/subsystems/Launcher.java b/src/main/java/frc/robot/subsystems/Launcher.java new file mode 100644 index 00000000..2e0bc4c1 --- /dev/null +++ b/src/main/java/frc/robot/subsystems/Launcher.java @@ -0,0 +1,7 @@ +package frc.robot.subsystems; + +import org.frc5010.common.arch.GenericSubsystem; + +public class Launcher extends GenericSubsystem { + +} From 466bfa177e1de9c9a369ad5facb7c9e70ff616ba Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 14 Jan 2026 17:17:28 -0500 Subject: [PATCH 005/371] intake --- src/main/deploy/tigershark/subsystems/intake.json | 0 src/main/deploy/tigershark/subsystems/intakeConfig/intake.json | 0 src/main/deploy/tigershark/subsystems/intakeConfig/winch.json | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/deploy/tigershark/subsystems/intake.json create mode 100644 src/main/deploy/tigershark/subsystems/intakeConfig/intake.json create mode 100644 src/main/deploy/tigershark/subsystems/intakeConfig/winch.json diff --git a/src/main/deploy/tigershark/subsystems/intake.json b/src/main/deploy/tigershark/subsystems/intake.json new file mode 100644 index 00000000..e69de29b diff --git a/src/main/deploy/tigershark/subsystems/intakeConfig/intake.json b/src/main/deploy/tigershark/subsystems/intakeConfig/intake.json new file mode 100644 index 00000000..e69de29b diff --git a/src/main/deploy/tigershark/subsystems/intakeConfig/winch.json b/src/main/deploy/tigershark/subsystems/intakeConfig/winch.json new file mode 100644 index 00000000..e69de29b From 73c107a6b1531bcdadc89cfc1e7423aaf17b0840 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Wed, 14 Jan 2026 17:18:57 -0500 Subject: [PATCH 006/371] Added Rebuilt Robot Deploy and java --- .../rebuilt_robot/akit_swerve_drivetrain.json | 164 ++++++++++++++++++ src/main/deploy/rebuilt_robot/cameras.json | 3 + .../deploy/rebuilt_robot/cameras/intake.json | 13 ++ .../rebuilt_robot/cameras/localization.json | 13 ++ .../deploy/rebuilt_robot/cameras/quest.json | 11 ++ .../deploy/rebuilt_robot/cameras/shooter.json | 20 +++ .../rebuilt_robot/competition_mode.json | 6 + .../deploy/rebuilt_robot/controllers.json | 6 + .../controllers/axis/driver_left_trigger.json | 8 + .../controllers/axis/driver_left_x.json | 8 + .../controllers/axis/driver_left_y.json | 8 + .../axis/driver_right_trigger.json | 8 + .../controllers/axis/driver_right_x.json | 8 + .../controllers/axis/operator_left_y.json | 9 + .../controllers/axis/operator_right_y.json | 9 + .../rebuilt_robot/controllers/driver.json | 11 ++ .../rebuilt_robot/controllers/operator.json | 8 + src/main/deploy/rebuilt_robot/demo_mode.json | 6 + .../rebuilt_robot/drive_modules/backleft.json | 5 + .../drive_modules/backright.json | 5 + .../drive_modules/frontleft.json | 5 + .../drive_modules/frontright.json | 5 + .../rebuilt_robot/field/game_pieces.json | 10 ++ src/main/deploy/rebuilt_robot/robot.json | 16 ++ .../rebuilt_robot/subsystems/led_strip.json | 16 ++ .../rebuilt_robot/yagsl_drivetrain.json | 24 +++ .../yagsl_swerve/controllerproperties.json | 8 + .../yagsl_swerve/modules/backleft.json | 26 +++ .../yagsl_swerve/modules/backright.json | 26 +++ .../yagsl_swerve/modules/frontleft.json | 26 +++ .../yagsl_swerve/modules/frontright.json | 26 +++ .../modules/physicalproperties.json | 24 +++ .../yagsl_swerve/modules/pidfproperties.json | 16 ++ .../yagsl_swerve/swervedrive.json | 14 ++ src/main/java/frc/robot/rebuilt/Rebuilt.java | 17 ++ 35 files changed, 588 insertions(+) create mode 100644 src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json create mode 100644 src/main/deploy/rebuilt_robot/cameras.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/intake.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/localization.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/quest.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/shooter.json create mode 100644 src/main/deploy/rebuilt_robot/competition_mode.json create mode 100644 src/main/deploy/rebuilt_robot/controllers.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/driver_left_trigger.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/driver_left_x.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/driver_left_y.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/driver_right_trigger.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/driver_right_x.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/operator_left_y.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/axis/operator_right_y.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/driver.json create mode 100644 src/main/deploy/rebuilt_robot/controllers/operator.json create mode 100644 src/main/deploy/rebuilt_robot/demo_mode.json create mode 100644 src/main/deploy/rebuilt_robot/drive_modules/backleft.json create mode 100644 src/main/deploy/rebuilt_robot/drive_modules/backright.json create mode 100644 src/main/deploy/rebuilt_robot/drive_modules/frontleft.json create mode 100644 src/main/deploy/rebuilt_robot/drive_modules/frontright.json create mode 100644 src/main/deploy/rebuilt_robot/field/game_pieces.json create mode 100644 src/main/deploy/rebuilt_robot/robot.json create mode 100644 src/main/deploy/rebuilt_robot/subsystems/led_strip.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_drivetrain.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/controllerproperties.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backleft.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backright.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontleft.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontright.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/physicalproperties.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/modules/pidfproperties.json create mode 100644 src/main/deploy/rebuilt_robot/yagsl_swerve/swervedrive.json create mode 100644 src/main/java/frc/robot/rebuilt/Rebuilt.java diff --git a/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json b/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json new file mode 100644 index 00000000..4f295f3a --- /dev/null +++ b/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json @@ -0,0 +1,164 @@ +{ + "type": "TalonFX", + "constants": { + "trackWidth": { + "val": 22, + "uom": "inches" + }, + "wheelBase": { + "val": 22, + "uom": "inches" + }, + "wheelDiameter": { + "val": 3.955, + "uom": "inches" + }, + "maxDriveSpeed": { + "val": 4.69, + "uom": "m/sec" + }, + "bumperFrameLength": { + "val": 30, + "uom": "inches" + }, + "bumperFrameWidth": { + "val": 30, + "uom": "inches" + }, + "gyro": { + "type": "pigeon2", + "id": 50, + "inverted": false, + "canbus": "" + }, + "driveGearRatio": "1:6.75", + "steerGearRatio": "1:25", + "driveMotorControl": { + "feedBack": { + "p": 0.1, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.2, + "v": 0.124, + "a": 0.0 + } + }, + "steerMotorControl": { + "feedBack": { + "p": 100, + "i": 0.0, + "d": 0.5 + }, + "feedForward": { + "s": 0.1, + "v": 1.91, + "a": 0.0 + } + }, + "modules": { + "frontLeft": { + "driveMotorSetup": { + "name": "frontLeftDrive", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 4 + }, + "steerMotorSetup": { + "name": "frontLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 3 + }, + "encoderId": 13, + "absoluteOffset": { + "val": 0.15234375, + "uom": "rotations" + }, + "encoderInverted": false + }, + "frontRight": { + "driveMotorSetup": { + "name": "frontRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 2 + }, + "steerMotorSetup": { + "name": "frontRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 1 + }, + "encoderId": 16, + "absoluteOffset": { + "val": -0.4873046875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backLeft": { + "driveMotorSetup": { + "name": "backLeftDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 6 + }, + "steerMotorSetup": { + "name": "backLeftSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 5 + }, + "encoderId": 14, + "absoluteOffset": { + "val": -0.219482421875, + "uom": "rotations" + }, + "encoderInverted": false + }, + "backRight": { + "driveMotorSetup": { + "name": "backRightDrive", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 8 + }, + "steerMotorSetup": { + "name": "backRightSteer", + "controllerType": "talonfx", + "motorType": "Krakenx60", + "canId": 7 + }, + "encoderId": 15, + "absoluteOffset": { + "val": 0.17236328125, + "uom": "rotations" + }, + "encoderInverted": false + } + }, + "coupleRatio": 3.8181818181818183, + "invertLeftSide": true, + "invertRightSide": true, + "steerInertia": { + "val": 0.04, + "uom": "kg*m^2" + }, + "driveInertia": { + "val": 0.025, + "uom": "kg*m^2" + }, + "robotMass": { + "val": 50, + "uom": "kg" + }, + "wheelCOF": 1.2, + "slipCurrent": { + "val": 120, + "uom": "amps" + }, + "canbus": "" + } +} diff --git a/src/main/deploy/rebuilt_robot/cameras.json b/src/main/deploy/rebuilt_robot/cameras.json new file mode 100644 index 00000000..bfdc48b6 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras.json @@ -0,0 +1,3 @@ +{ + "cameras": [] +} diff --git a/src/main/deploy/rebuilt_robot/cameras/intake.json b/src/main/deploy/rebuilt_robot/cameras/intake.json new file mode 100644 index 00000000..33938add --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/intake.json @@ -0,0 +1,13 @@ +{ + "name": "intake", + "use": "target", + "type": "limelight", + "column": 0, + "x": 0.15, + "y": 0.05, + "z": 0.2, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetHeight": 0.02 +} diff --git a/src/main/deploy/rebuilt_robot/cameras/localization.json b/src/main/deploy/rebuilt_robot/cameras/localization.json new file mode 100644 index 00000000..706b561a --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/localization.json @@ -0,0 +1,13 @@ +{ + "name": "localization", + "use": "apriltag", + "type": "limelight", + "strategy": "LOWEST_AMBIGUITY", + "column": 0, + "x": -0.35, + "y": -0.25, + "z": 0.5, + "roll": 0, + "pitch": -20, + "yaw": 180 +} diff --git a/src/main/deploy/rebuilt_robot/cameras/quest.json b/src/main/deploy/rebuilt_robot/cameras/quest.json new file mode 100644 index 00000000..df412311 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/quest.json @@ -0,0 +1,11 @@ +{ + "name": "quest", + "use": "quest", + "column": 0, + "x": 0, + "y": 0, + "z": 18, + "roll": 0, + "pitch": 0, + "yaw": 0 +} diff --git a/src/main/deploy/rebuilt_robot/cameras/shooter.json b/src/main/deploy/rebuilt_robot/cameras/shooter.json new file mode 100644 index 00000000..9cf3bb35 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/shooter.json @@ -0,0 +1,20 @@ +{ + "name": "shooter", + "use": "target", + "type": "photonvision", + "column": 0, + "x": 0.25, + "y": 0, + "z": 0.25, + "roll": 0, + "pitch": 10, + "yaw": 0, + "targetFiducialIds": [ + 17, + 18, + 19, + 20, + 21, + 22 + ] +} diff --git a/src/main/deploy/rebuilt_robot/competition_mode.json b/src/main/deploy/rebuilt_robot/competition_mode.json new file mode 100644 index 00000000..f67b949b --- /dev/null +++ b/src/main/deploy/rebuilt_robot/competition_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 6.0, + "maxAngularSpeed": 6.0, + "maxAccelleration": 3.0, + "maxAngularAccelleration": 18.75 +} diff --git a/src/main/deploy/rebuilt_robot/controllers.json b/src/main/deploy/rebuilt_robot/controllers.json new file mode 100644 index 00000000..c6c86acb --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers.json @@ -0,0 +1,6 @@ +{ + "controllers": [ + "driver.json", + "operator.json" + ] +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_trigger.json b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_trigger.json new file mode 100644 index 00000000..41b79133 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 2, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_x.json b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_x.json new file mode 100644 index 00000000..d77f0e91 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_x.json @@ -0,0 +1,8 @@ +{ + "channel": 0, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_y.json b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_y.json new file mode 100644 index 00000000..d826731e --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/driver_left_y.json @@ -0,0 +1,8 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_trigger.json b/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_trigger.json new file mode 100644 index 00000000..47b46917 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_trigger.json @@ -0,0 +1,8 @@ +{ + "channel": 3, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_x.json b/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_x.json new file mode 100644 index 00000000..8f981e23 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/driver_right_x.json @@ -0,0 +1,8 @@ +{ + "channel": 4, + "deadband": 0.07, + "invert": true, + "scale": 1.0, + "curvePower": 3, + "limit": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/operator_left_y.json b/src/main/deploy/rebuilt_robot/controllers/axis/operator_left_y.json new file mode 100644 index 00000000..c13bd0e0 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/operator_left_y.json @@ -0,0 +1,9 @@ +{ + "channel": 1, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/axis/operator_right_y.json b/src/main/deploy/rebuilt_robot/controllers/axis/operator_right_y.json new file mode 100644 index 00000000..2668956f --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/axis/operator_right_y.json @@ -0,0 +1,9 @@ +{ + "channel": 5, + "deadband": 0.07, + "invert": "true", + "scale": 1.0, + "curvePower": 3.0, + "limit": 1.0, + "rate": 1.0 +} diff --git a/src/main/deploy/rebuilt_robot/controllers/driver.json b/src/main/deploy/rebuilt_robot/controllers/driver.json new file mode 100644 index 00000000..e2dbc76a --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/driver.json @@ -0,0 +1,11 @@ +{ + "name": "driver", + "port": 0, + "axis": [ + "driver_left_y.json", + "driver_left_x.json", + "driver_right_x.json", + "driver_left_trigger.json", + "driver_right_trigger.json" + ] +} diff --git a/src/main/deploy/rebuilt_robot/controllers/operator.json b/src/main/deploy/rebuilt_robot/controllers/operator.json new file mode 100644 index 00000000..858cfea8 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/controllers/operator.json @@ -0,0 +1,8 @@ +{ + "name": "operator", + "port": 1, + "axis": [ + "operator_left_y.json", + "operator_right_y.json" + ] +} diff --git a/src/main/deploy/rebuilt_robot/demo_mode.json b/src/main/deploy/rebuilt_robot/demo_mode.json new file mode 100644 index 00000000..f60f73c9 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/demo_mode.json @@ -0,0 +1,6 @@ +{ + "maxSpeed": 2.0, + "maxAngularSpeed": 2.0, + "maxAccelleration": 1.0, + "maxAngularAccelleration": 9.0 +} diff --git a/src/main/deploy/rebuilt_robot/drive_modules/backleft.json b/src/main/deploy/rebuilt_robot/drive_modules/backleft.json new file mode 100644 index 00000000..c62ce932 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/drive_modules/backleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.19542, + "v": 2.2924, + "a": 0.35934 +} diff --git a/src/main/deploy/rebuilt_robot/drive_modules/backright.json b/src/main/deploy/rebuilt_robot/drive_modules/backright.json new file mode 100644 index 00000000..aee7fd95 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/drive_modules/backright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18096, + "v": 2.2915, + "a": 0.37156 +} diff --git a/src/main/deploy/rebuilt_robot/drive_modules/frontleft.json b/src/main/deploy/rebuilt_robot/drive_modules/frontleft.json new file mode 100644 index 00000000..bdf7d3fa --- /dev/null +++ b/src/main/deploy/rebuilt_robot/drive_modules/frontleft.json @@ -0,0 +1,5 @@ +{ + "s": 0.21848, + "v": 2.3118, + "a": 0.20314 +} diff --git a/src/main/deploy/rebuilt_robot/drive_modules/frontright.json b/src/main/deploy/rebuilt_robot/drive_modules/frontright.json new file mode 100644 index 00000000..36a1c209 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/drive_modules/frontright.json @@ -0,0 +1,5 @@ +{ + "s": 0.18434, + "v": 2.3018, + "a": 0.30992 +} diff --git a/src/main/deploy/rebuilt_robot/field/game_pieces.json b/src/main/deploy/rebuilt_robot/field/game_pieces.json new file mode 100644 index 00000000..b13b37c1 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/field/game_pieces.json @@ -0,0 +1,10 @@ +{ + "gamePieces": [ + { + "x": 2, + "y": 7, + "type": "Coral", + "rotation": 0 + } + ] +} diff --git a/src/main/deploy/rebuilt_robot/robot.json b/src/main/deploy/rebuilt_robot/robot.json new file mode 100644 index 00000000..0a20f3e5 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/robot.json @@ -0,0 +1,16 @@ +{ + "userConfig": "competition_mode.json", + "driveType": "AKIT_SWERVE_DRIVE", + "trackWidth": 16.8, + "trackWidthUom": "in", + "wheelBase": 18.5, + "wheelBaseUom": "in", + "wheelDiameter": 0.103386904, + "wheelDiameterUom": "m", + "physicalMaxSpeed": 5.93, + "physicalMaxSpeedUom": "m/s", + "driveMotorGearRatio": 1.0, + "loadSimulatedField": true, + "gamePieceA": "Coral", + "gamePieceB": "Algae" +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/led_strip.json b/src/main/deploy/rebuilt_robot/subsystems/led_strip.json new file mode 100644 index 00000000..25c307af --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/led_strip.json @@ -0,0 +1,16 @@ +{ + "length": 30, + "dataPin": 0, + "segments": [ + { + "name": "status_indicator", + "start": 0, + "end": 9 + }, + { + "name": "team_colors", + "start": 10, + "end": 29 + } + ] +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_drivetrain.json b/src/main/deploy/rebuilt_robot/yagsl_drivetrain.json new file mode 100644 index 00000000..c6beb5d7 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_drivetrain.json @@ -0,0 +1,24 @@ +{ + "directory": "basic_robot/yagsl_swerve", + "turningMotorGearRatio": 1.0, + "driveModules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ], + "startingPose": { + "x": { + "val": 1.0, + "uom": "m" + }, + "y": { + "val": 1.0, + "uom": "m" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/controllerproperties.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/controllerproperties.json new file mode 100644 index 00000000..dd353caf --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/controllerproperties.json @@ -0,0 +1,8 @@ +{ + "angleJoystickRadiusDeadband": 0.05, + "heading": { + "p": 0.4, + "i": 0, + "d": 0.01 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backleft.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backleft.json new file mode 100644 index 00000000..2ac2a1ab --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 17, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 6, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backright.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backright.json new file mode 100644 index 00000000..eea317b8 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/backright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 18, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 2, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": -8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontleft.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontleft.json new file mode 100644 index 00000000..1c03c3f1 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontleft.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 15, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 4, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": 10.88 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontright.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontright.json new file mode 100644 index 00000000..6218565f --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/frontright.json @@ -0,0 +1,26 @@ +{ + "drive": { + "type": "neo", + "id": 16, + "canbus": null + }, + "angle": { + "type": "neo", + "id": 3, + "canbus": null + }, + "encoder": { + "type": "canandcoder", + "id": 0, + "canbus": null + }, + "inverted": { + "drive": true, + "angle": true + }, + "absoluteEncoderInverted": true, + "location": { + "front": 8.37, + "left": -10.88 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/physicalproperties.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/physicalproperties.json new file mode 100644 index 00000000..c921b000 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/physicalproperties.json @@ -0,0 +1,24 @@ +{ + "conversionFactors": { + "angle": { + "gearRatio": 12.8, + "factor": 0 + }, + "drive": { + "gearRatio": 8.14, + "diameter": 4, + "factor": 0 + } + }, + "currentLimit": { + "drive": 100, + "angle": 20 + }, + "rampRate": { + "drive": 0.15, + "angle": 0.05 + }, + "wheelGripCoefficientOfFriction": 1.19, + "optimalVoltage": 12, + "robotMass": 75 +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/pidfproperties.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/pidfproperties.json new file mode 100644 index 00000000..5924fdbb --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/modules/pidfproperties.json @@ -0,0 +1,16 @@ +{ + "drive": { + "p": 0.00023, + "i": 0.0000002, + "d": 1, + "f": 0, + "iz": 0 + }, + "angle": { + "p": 0.0020645, + "i": 0, + "d": 0, + "f": 0.001, + "iz": 0 + } +} diff --git a/src/main/deploy/rebuilt_robot/yagsl_swerve/swervedrive.json b/src/main/deploy/rebuilt_robot/yagsl_swerve/swervedrive.json new file mode 100644 index 00000000..f4876233 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/yagsl_swerve/swervedrive.json @@ -0,0 +1,14 @@ +{ + "imu": { + "type": "pigeon2", + "id": 13, + "canbus": "" + }, + "invertedIMU": false, + "modules": [ + "frontleft.json", + "frontright.json", + "backleft.json", + "backright.json" + ] +} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java new file mode 100644 index 00000000..5188153d --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Rebuilt extends SubsystemBase { + /** Creates a new Rebuilt. */ + public Rebuilt() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} From 80e387a0ef499ba1c40d9e3c195a1633e376c53b Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 17:23:34 -0500 Subject: [PATCH 007/371] Moved Launcher and Indexer subsystems from tigershark to rebuilt_robot Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- .../deploy/{tigershark => rebuilt_robot}/subsystems/indexer.json | 0 .../{tigershark => rebuilt_robot}/subsystems/indexer/feeder.json | 0 .../{tigershark => rebuilt_robot}/subsystems/indexer/indexer.json | 0 .../deploy/{tigershark => rebuilt_robot}/subsystems/intake.json | 0 .../subsystems/intakeConfig/intake.json | 0 .../subsystems/intakeConfig/winch.json | 0 .../deploy/{tigershark => rebuilt_robot}/subsystems/launcher.json | 0 .../{tigershark => rebuilt_robot}/subsystems/launcher/hood.json | 0 .../subsystems/launcher/shooter.json | 0 .../{tigershark => rebuilt_robot}/subsystems/launcher/turret.json | 0 src/main/java/frc/robot/Launcher/Launcher.java | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/indexer.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/indexer/feeder.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/indexer/indexer.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/intake.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/intakeConfig/intake.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/intakeConfig/winch.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/launcher.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/launcher/hood.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/launcher/shooter.json (100%) rename src/main/deploy/{tigershark => rebuilt_robot}/subsystems/launcher/turret.json (100%) delete mode 100644 src/main/java/frc/robot/Launcher/Launcher.java diff --git a/src/main/deploy/tigershark/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/indexer.json rename to src/main/deploy/rebuilt_robot/subsystems/indexer.json diff --git a/src/main/deploy/tigershark/subsystems/indexer/feeder.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/indexer/feeder.json rename to src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json diff --git a/src/main/deploy/tigershark/subsystems/indexer/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/indexer/indexer.json rename to src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json diff --git a/src/main/deploy/tigershark/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/intake.json rename to src/main/deploy/rebuilt_robot/subsystems/intake.json diff --git a/src/main/deploy/tigershark/subsystems/intakeConfig/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intakeConfig/intake.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/intakeConfig/intake.json rename to src/main/deploy/rebuilt_robot/subsystems/intakeConfig/intake.json diff --git a/src/main/deploy/tigershark/subsystems/intakeConfig/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intakeConfig/winch.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/intakeConfig/winch.json rename to src/main/deploy/rebuilt_robot/subsystems/intakeConfig/winch.json diff --git a/src/main/deploy/tigershark/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/launcher.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher.json diff --git a/src/main/deploy/tigershark/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/launcher/hood.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json diff --git a/src/main/deploy/tigershark/subsystems/launcher/shooter.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/launcher/shooter.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json diff --git a/src/main/deploy/tigershark/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json similarity index 100% rename from src/main/deploy/tigershark/subsystems/launcher/turret.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json diff --git a/src/main/java/frc/robot/Launcher/Launcher.java b/src/main/java/frc/robot/Launcher/Launcher.java deleted file mode 100644 index e69de29b..00000000 From b3882e74be589b23aac99959a5b80067a38b6d06 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 17:30:47 -0500 Subject: [PATCH 008/371] Fixed File name and locations Camillia.johnson DINDT CAPITALIZE THE I IN Indexer.json Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- .../{subsystems/indexer.java => rebuilt/subsystems/Indexer.java} | 0 src/main/java/frc/robot/{ => rebuilt}/subsystems/Launcher.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/main/java/frc/robot/{subsystems/indexer.java => rebuilt/subsystems/Indexer.java} (100%) rename src/main/java/frc/robot/{ => rebuilt}/subsystems/Launcher.java (100%) diff --git a/src/main/java/frc/robot/subsystems/indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java similarity index 100% rename from src/main/java/frc/robot/subsystems/indexer.java rename to src/main/java/frc/robot/rebuilt/subsystems/Indexer.java diff --git a/src/main/java/frc/robot/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java similarity index 100% rename from src/main/java/frc/robot/subsystems/Launcher.java rename to src/main/java/frc/robot/rebuilt/subsystems/Launcher.java From 3bdfb9d29215993dae4032fc3a115c09a5be21b0 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 17:32:19 -0500 Subject: [PATCH 009/371] Task 17 --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 5188153d..93f05471 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -3,10 +3,24 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.rebuilt; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.motors.function.PercentControlMotor; +import org.frc5010.common.sensors.Controller; import edu.wpi.first.wpilibj2.command.SubsystemBase; -public class Rebuilt extends SubsystemBase { + +public class Rebuilt extends SubsystemBase { + SwerveConstants swerveConstants; + GenericDrivetrain drivetrain; + PercentControlMotor percentControlMotor; + indexer indexer; + Launcher launcher; + StateMachine stateMachine = new StateMachine("RebuiltStateMachine"); /** Creates a new Rebuilt. */ public Rebuilt() {} From 3cfcfc48f68ef7f4e046f36a9ddf7ace3823b941 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 17:39:19 -0500 Subject: [PATCH 010/371] made a mistake earlier new code --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 93f05471..5d292df4 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -10,15 +10,17 @@ import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; +import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Launcher; import edu.wpi.first.wpilibj2.command.SubsystemBase; -public class Rebuilt extends SubsystemBase { +public class Rebuilt extends SubsystemBase { SwerveConstants swerveConstants; GenericDrivetrain drivetrain; PercentControlMotor percentControlMotor; - indexer indexer; + Indexer indexer; Launcher launcher; StateMachine stateMachine = new StateMachine("RebuiltStateMachine"); /** Creates a new Rebuilt. */ From c9b01d5538ec5f16c64e0102aac3890194a932f2 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Wed, 14 Jan 2026 17:44:01 -0500 Subject: [PATCH 011/371] Refactor subsystems for rebuilt robot architecture Moved Climb, Indexer, Intake, and Launcher subsystems to frc.robot.rebuilt.subsystems and removed legacy subsystem files. Updated Rebuilt.java to extend GenericRobot and implement new robot structure. Added rebuilt_robot configuration to robots.json and made related simgui.json changes for auto modes. Updated build constants and cleaned up formatting in launcher.json. --- simgui.json | 10 ++-- src/main/deploy/robots.json | 10 +++- .../tigershark/subsystems/launcher.json | 10 ++-- src/main/java/frc/robot/BuildConstants.java | 10 ++-- .../java/frc/robot/Launcher/Launcher.java | 0 src/main/java/frc/robot/rebuilt/Rebuilt.java | 46 ++++++++++++++++--- .../frc/robot/rebuilt/subsystems/Climb.java | 17 +++++++ .../frc/robot/rebuilt/subsystems/Indexer.java | 17 +++++++ .../frc/robot/rebuilt/subsystems/Intake.java | 17 +++++++ .../robot/rebuilt/subsystems/Launcher.java | 17 +++++++ .../java/frc/robot/subsystems/Launcher.java | 7 --- .../java/frc/robot/subsystems/indexer.java | 0 12 files changed, 133 insertions(+), 28 deletions(-) delete mode 100644 src/main/java/frc/robot/Launcher/Launcher.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Climb.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Indexer.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Intake.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Launcher.java delete mode 100644 src/main/java/frc/robot/subsystems/Launcher.java delete mode 100644 src/main/java/frc/robot/subsystems/indexer.java diff --git a/simgui.json b/simgui.json index 958ef3d4..a359bc56 100644 --- a/simgui.json +++ b/simgui.json @@ -112,6 +112,7 @@ "/SmartDashboard/PhotonAlerts": "Alerts", "/SmartDashboard/Pigeon 2 (v6) [13]": "Gyro", "/SmartDashboard/Pigeon 2 [13]": "Gyro", + "/SmartDashboard/Rebuilt/Auto Modes": "String Chooser", "/SmartDashboard/Robot Visual": "Mechanism2d", "/SmartDashboard/SendableChooser[0]": "String Chooser", "/SmartDashboard/Shooter/mechanism": "Mechanism2d", @@ -700,17 +701,17 @@ "visible": true } }, - "/SmartDashboard/Robot Visual": { + "/SmartDashboard/Rebuilt/Auto Modes": { "window": { "visible": true } }, - "/SmartDashboard/Shooter/mechanism": { + "/SmartDashboard/Robot Visual": { "window": { "visible": true } }, - "/SmartDashboard/TigerShark/Auto Modes": { + "/SmartDashboard/Shooter/mechanism": { "window": { "visible": true } @@ -828,5 +829,8 @@ }, "NetworkTables Info": { "visible": true + }, + "NetworkTables View": { + "visible": false } } diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index 011f9cb9..9941b7a7 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -9,14 +9,20 @@ "tigershark": { "id": "00:80:2F:38:90:61", "robotClass": "frc.robot.tigershark.TigerShark", - "simulate": true, - "competition": true + "simulate": false, + "competition": false }, "alpha": { "id": "alpha", "robotClass": "frc.robot.alpha.Alpha", "simulate": false }, + "rebuilt_robot": { + "id": "rebuilt", + "robotClass": "frc.robot.rebuilt.Rebuilt", + "simulate": true, + "competition": false + }, "baby_swerve": { "id": "00:80:2F:24:6D:74", "robotClass": "frc.robot.baby_swerve.BabySwerve", diff --git a/src/main/deploy/tigershark/subsystems/launcher.json b/src/main/deploy/tigershark/subsystems/launcher.json index 489170ae..bb4fb378 100644 --- a/src/main/deploy/tigershark/subsystems/launcher.json +++ b/src/main/deploy/tigershark/subsystems/launcher.json @@ -1,5 +1,5 @@ -{ - "shooter": "launcher/shooter.json", - "hood": "launcher/hood.json", - "turret": "launcher/turret.json" -} \ No newline at end of file +{ + "shooter": "launcher/shooter.json", + "hood": "launcher/hood.json", + "turret": "launcher/turret.json" +} diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index df9477d2..88c7debd 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 71; - public static final String GIT_SHA = "29dabbcd95f177097ec91cc371950f5e9efdb899"; - public static final String GIT_DATE = "2026-01-12 17:30:35 EST"; + public static final int GIT_REVISION = 82; + public static final String GIT_SHA = "bbfe8d9ea52971e4d3b79d1a2cb5cba1548ac144"; + public static final String GIT_DATE = "2026-01-14 17:19:14 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-12 18:54:29 EST"; - public static final long BUILD_UNIX_TIME = 1768262069859L; + public static final String BUILD_DATE = "2026-01-14 17:38:05 EST"; + public static final long BUILD_UNIX_TIME = 1768430285886L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/Launcher/Launcher.java b/src/main/java/frc/robot/Launcher/Launcher.java deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 5188153d..dceb3f11 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,14 +4,48 @@ package frc.robot.rebuilt; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.motors.function.PercentControlMotor; +import org.frc5010.common.sensors.Controller; -public class Rebuilt extends SubsystemBase { - /** Creates a new Rebuilt. */ - public Rebuilt() {} +/** This is an example robot class. */ +public class Rebuilt extends GenericRobot { + SwerveConstants swerveConstants; + GenericDrivetrain drivetrain; + PercentControlMotor percentControlMotor; + StateMachine stateMachine = new StateMachine("ExampleStateMachine"); + + public Rebuilt(String directory) { + super(directory); + drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); + } + + @Override + public void configureButtonBindings(Controller driver, Controller operator) {} + + @Override + public void setupDefaultCommands(Controller driver, Controller operator) {} + + @Override + public void initAutoCommands() { + drivetrain.setAutoBuilder(); + } + + @Override + public Command generateAutoCommand(Command autoCommand) { + return drivetrain.generateAutoCommand(autoCommand); + } @Override - public void periodic() { - // This method will be called once per scheduler run + public void buildAutoCommands() { + super.buildAutoCommands(); + selectableCommand.addOption("Do Nothing", Commands.none()); + drivetrain.addAutoCommands(selectableCommand); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java new file mode 100644 index 00000000..16b8a6db --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt.subsystems; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Climb extends SubsystemBase { + /** Creates a new Climb. */ + public Climb() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java new file mode 100644 index 00000000..35ce73ba --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt.subsystems; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Indexer extends SubsystemBase { + /** Creates a new Index. */ + public Indexer() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java new file mode 100644 index 00000000..89bfcb40 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt.subsystems; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Intake extends SubsystemBase { + /** Creates a new Intake. */ + public Intake() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java new file mode 100644 index 00000000..5c22db04 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt.subsystems; + +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Launcher extends SubsystemBase { + /** Creates a new Launcher. */ + public Launcher() {} + + @Override + public void periodic() { + // This method will be called once per scheduler run + } +} diff --git a/src/main/java/frc/robot/subsystems/Launcher.java b/src/main/java/frc/robot/subsystems/Launcher.java deleted file mode 100644 index 2e0bc4c1..00000000 --- a/src/main/java/frc/robot/subsystems/Launcher.java +++ /dev/null @@ -1,7 +0,0 @@ -package frc.robot.subsystems; - -import org.frc5010.common.arch.GenericSubsystem; - -public class Launcher extends GenericSubsystem { - -} diff --git a/src/main/java/frc/robot/subsystems/indexer.java b/src/main/java/frc/robot/subsystems/indexer.java deleted file mode 100644 index e69de29b..00000000 From 2ae1dc36c0ff359ddd00d6ad1037a954c455e91b Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Wed, 14 Jan 2026 17:56:44 -0500 Subject: [PATCH 012/371] Refactor subsystem configs and update build info Added climb.json and updated indexer.json, intake.json, and launcher.json to use a unified 'devices' structure and enable display. Moved intakeConfig files to intake directory. Renamed motor name in launcher/hood.json. Updated BuildConstants and cleaned up imports in Rebuilt.java. --- src/main/deploy/rebuilt_robot/subsystems/climb.json | 8 ++++++++ src/main/deploy/rebuilt_robot/subsystems/indexer.json | 7 +++++++ src/main/deploy/rebuilt_robot/subsystems/intake.json | 7 +++++++ .../subsystems/{intakeConfig => intake}/intake.json | 0 .../subsystems/{intakeConfig => intake}/winch.json | 0 src/main/deploy/rebuilt_robot/subsystems/launcher.json | 9 ++++++--- .../deploy/rebuilt_robot/subsystems/launcher/hood.json | 2 +- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- src/main/java/frc/robot/rebuilt/Rebuilt.java | 10 ---------- 9 files changed, 34 insertions(+), 19 deletions(-) create mode 100644 src/main/deploy/rebuilt_robot/subsystems/climb.json rename src/main/deploy/rebuilt_robot/subsystems/{intakeConfig => intake}/intake.json (100%) rename src/main/deploy/rebuilt_robot/subsystems/{intakeConfig => intake}/winch.json (100%) diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb.json b/src/main/deploy/rebuilt_robot/subsystems/climb.json new file mode 100644 index 00000000..651395ca --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/climb.json @@ -0,0 +1,8 @@ +{ + "devices": { + "percent_motor": "example/percent_motor.json", + "velocity_motor": "example/velocity_motor.json", + "yams_shooter": "example/yams_shooter.json" + }, + "display": true +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json index e69de29b..35daaa3c 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer.json @@ -0,0 +1,7 @@ +{ + "devices": { + "feeder": "indexer/feeder.json", + "indexer": "indexer/indexer.json" + }, + "display": true +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index e69de29b..59cc228b 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -0,0 +1,7 @@ +{ + "devices": { + "intake": "intake/intake.json", + "winch": "intake/winch.json" + }, + "display": true +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intakeConfig/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json similarity index 100% rename from src/main/deploy/rebuilt_robot/subsystems/intakeConfig/intake.json rename to src/main/deploy/rebuilt_robot/subsystems/intake/intake.json diff --git a/src/main/deploy/rebuilt_robot/subsystems/intakeConfig/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json similarity index 100% rename from src/main/deploy/rebuilt_robot/subsystems/intakeConfig/winch.json rename to src/main/deploy/rebuilt_robot/subsystems/intake/winch.json diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json index bb4fb378..ad5010cf 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher.json @@ -1,5 +1,8 @@ { - "shooter": "launcher/shooter.json", - "hood": "launcher/hood.json", - "turret": "launcher/turret.json" + "devices": { + "hood": "launcher/hood.json", + "shooter": "launcher/shooter.json", + "turret": "launcher/turret.json" + }, + "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index 38cf9e27..9eb7c393 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -1,6 +1,6 @@ { "motorSetup": { - "name": "Arm", + "name": "Hood", "controllerType": "talonfx", "motorType": "KrakenX60", "canId": 11 diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 88c7debd..48763f57 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 82; - public static final String GIT_SHA = "bbfe8d9ea52971e4d3b79d1a2cb5cba1548ac144"; - public static final String GIT_DATE = "2026-01-14 17:19:14 EST"; + public static final int GIT_REVISION = 89; + public static final String GIT_SHA = "f0ac91a814be066acdaaf157fdd11a7e720ed2c9"; + public static final String GIT_DATE = "2026-01-14 17:46:10 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-14 17:38:05 EST"; - public static final long BUILD_UNIX_TIME = 1768430285886L; + public static final String BUILD_DATE = "2026-01-14 17:55:27 EST"; + public static final long BUILD_UNIX_TIME = 1768431327493L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 319f9267..dceb3f11 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -3,15 +3,6 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot.rebuilt; -import org.frc5010.common.arch.StateMachine; -import org.frc5010.common.arch.StateMachine.State; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.motors.function.PercentControlMotor; -import org.frc5010.common.sensors.Controller; -import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Launcher; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; @@ -23,7 +14,6 @@ import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; - /** This is an example robot class. */ public class Rebuilt extends GenericRobot { SwerveConstants swerveConstants; From 4a30f016fb22ffee74fed158ce7fc081c670d2f8 Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Wed, 14 Jan 2026 18:41:39 -0500 Subject: [PATCH 013/371] Add subsystem JSON configs and update constructors Added initial JSON configuration files for feeder, indexer, intake, and winch subsystems. Updated motor names and CAN IDs in launcher subsystem configs. Modified subsystem constructors to load their respective JSON files. Updated encoderId in DrivetrainConstantsJson and incremented build constants. --- .../subsystems/indexer/feeder.json | 17 ++++++ .../subsystems/indexer/indexer.json | 18 ++++++ .../subsystems/intake/intake.json | 10 ++++ .../subsystems/intake/winch.json | 59 +++++++++++++++++++ .../subsystems/launcher/hood.json | 4 +- .../subsystems/launcher/shooter.json | 4 +- .../subsystems/launcher/turret.json | 4 +- src/main/java/frc/robot/BuildConstants.java | 10 ++-- .../frc/robot/rebuilt/subsystems/Climb.java | 4 +- .../frc/robot/rebuilt/subsystems/Indexer.java | 4 +- .../frc/robot/rebuilt/subsystems/Intake.java | 4 +- .../robot/rebuilt/subsystems/Launcher.java | 4 +- .../json/devices/DrivetrainConstantsJson.java | 2 +- 13 files changed, 128 insertions(+), 16 deletions(-) diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json index e69de29b..fdef190c 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json @@ -0,0 +1,17 @@ +{ + "name": "feeder_motor", + "controller": "spark", + "type": "neo", + "id": 9, + "gearing": 1.0, + "x": -0.25, + "y": 0.0, + "z": 0.25, + "kP": 0.1, + "kI": 0.0, + "kD": 0.01, + "iZone": 0.0, + "kS": 0.1, + "kV": 0.1, + "kA": 0.0 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json index e69de29b..cd57fa0d 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json @@ -0,0 +1,18 @@ +{ + "name": "indexer_motor", + "controller": "spark", + "type": "Neo", + "id": 10, + "gearing": 1.0, + "momentOfInertiaKgMSq": 1.0, + "x": -0.25, + "y": 0.0, + "z": 0.25, + "kP": 0.1, + "kI": 0.0, + "kD": 0.01, + "iZone": 0.0, + "kS": 0.1, + "kV": 0.1, + "kA": 0.0 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json index e69de29b..2ae570d0 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json @@ -0,0 +1,10 @@ +{ + "name": "intake_motor", + "controller": "spark", + "id": 11, + "gearing": 1.0, + "momentOfInertiaKgMSq": 1.0, + "x": 0.5, + "y": 0.0, + "z": 0.25 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json index e69de29b..55a1ddb7 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json @@ -0,0 +1,59 @@ +{ + "motorSetup": { + "name": "winch_motor", + "controllerType": "spark", + "motorType": "Neo", + "canId": 12 + }, + "motorSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "OPEN_LOOP" + }, + "sprocketTeeth": 22, + "lowerSoftLimit": { + "val": 0.1, + "uom": "m" + }, + "upperSoftLimit": { + "val": 2, + "uom": "m" + }, + "lowerHardLimit": { + "val": 0.1, + "uom": "m" + }, + "upperHardLimit": { + "val": 3, + "uom": "m" + }, + "gearing": [ + 3, + 4 + ], + "startingPosition": { + "val": 0.5, + "uom": "m" + }, + "mass": { + "val": 16, + "uom": "lbs" + } +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index 9eb7c393..899445d1 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "Hood", + "name": "hood_motor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 11 + "canId": 13 }, "motorSystemId": { "feedBack": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json index 876b65fc..0be37a6e 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "Shooter", + "name": "shooter_motor", "controllerType": "spark", "motorType": "Neo", - "canId": 12 + "canId": 14 }, "motorSystemId": { "feedBack": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index 329453e1..2629504a 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "Turret", + "name": "turret_motor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 12 + "canId": 15 }, "motorSystemId": { "feedBack": { diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 48763f57..3143faf5 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 89; - public static final String GIT_SHA = "f0ac91a814be066acdaaf157fdd11a7e720ed2c9"; - public static final String GIT_DATE = "2026-01-14 17:46:10 EST"; + public static final int GIT_REVISION = 90; + public static final String GIT_SHA = "2ae1dc36c0ff359ddd00d6ad1037a954c455e91b"; + public static final String GIT_DATE = "2026-01-14 17:56:44 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-14 17:55:27 EST"; - public static final long BUILD_UNIX_TIME = 1768431327493L; + public static final String BUILD_DATE = "2026-01-14 18:26:28 EST"; + public static final long BUILD_UNIX_TIME = 1768433188098L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java index 16b8a6db..1b65dd8e 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java @@ -8,7 +8,9 @@ public class Climb extends SubsystemBase { /** Creates a new Climb. */ - public Climb() {} + public Climb() { + super("climb.json"); + } @Override public void periodic() { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java index 35ce73ba..854c75d8 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java @@ -8,7 +8,9 @@ public class Indexer extends SubsystemBase { /** Creates a new Index. */ - public Indexer() {} + public Indexer() { + super("indexer.json"); + } @Override public void periodic() { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java index 89bfcb40..63194bc0 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java @@ -8,7 +8,9 @@ public class Intake extends SubsystemBase { /** Creates a new Intake. */ - public Intake() {} + public Intake() { + super("intake.json"); + } @Override public void periodic() { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index 5c22db04..351b6c6a 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -8,7 +8,9 @@ public class Launcher extends SubsystemBase { /** Creates a new Launcher. */ - public Launcher() {} + public Launcher() { + super("launcher.json"); + } @Override public void periodic() { diff --git a/src/main/java/org/frc5010/common/config/json/devices/DrivetrainConstantsJson.java b/src/main/java/org/frc5010/common/config/json/devices/DrivetrainConstantsJson.java index c1f2d67d..d91168e6 100644 --- a/src/main/java/org/frc5010/common/config/json/devices/DrivetrainConstantsJson.java +++ b/src/main/java/org/frc5010/common/config/json/devices/DrivetrainConstantsJson.java @@ -65,7 +65,7 @@ public static class ModuleConfigJson { /** The motor setup for the steer motor */ public MotorSetupJson steerMotorSetup = new MotorSetupJson(); /** The encoder ID */ - public int encoderId = 0; + public int encoderId = 2; /** The absolute encoder offset */ public UnitValueJson absoluteOffset = new UnitValueJson(0, "degrees"); /** Whether the encoder is inverted */ From 349d6fa4dddcd54f49c8592b07d8c45da4c2d96f Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 14 Jan 2026 18:45:44 -0500 Subject: [PATCH 014/371] autos --- .../autos/lose collecting n climb.auto | 25 + .../{New Auto.auto => win shoot climb.auto} | 2 +- src/main/deploy/pathplanner/navgrid.json | 2089 +---------------- .../deploy/pathplanner/paths/New Path.path | 70 - .../paths/lose collecting climb.path | 95 + .../pathplanner/paths/lose collecting.path | 95 + .../pathplanner/paths/win shoot n climb.path | 131 ++ 7 files changed, 348 insertions(+), 2159 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/lose collecting n climb.auto rename src/main/deploy/pathplanner/autos/{New Auto.auto => win shoot climb.auto} (85%) delete mode 100644 src/main/deploy/pathplanner/paths/New Path.path create mode 100644 src/main/deploy/pathplanner/paths/lose collecting climb.path create mode 100644 src/main/deploy/pathplanner/paths/lose collecting.path create mode 100644 src/main/deploy/pathplanner/paths/win shoot n climb.path diff --git a/src/main/deploy/pathplanner/autos/lose collecting n climb.auto b/src/main/deploy/pathplanner/autos/lose collecting n climb.auto new file mode 100644 index 00000000..391ecaea --- /dev/null +++ b/src/main/deploy/pathplanner/autos/lose collecting n climb.auto @@ -0,0 +1,25 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "lose collecting" + } + }, + { + "type": "path", + "data": { + "pathName": "lose collecting climb" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/New Auto.auto b/src/main/deploy/pathplanner/autos/win shoot climb.auto similarity index 85% rename from src/main/deploy/pathplanner/autos/New Auto.auto rename to src/main/deploy/pathplanner/autos/win shoot climb.auto index 268147bb..7c89d751 100644 --- a/src/main/deploy/pathplanner/autos/New Auto.auto +++ b/src/main/deploy/pathplanner/autos/win shoot climb.auto @@ -7,7 +7,7 @@ { "type": "path", "data": { - "pathName": "New Path" + "pathName": "win shoot n climb" } } ] diff --git a/src/main/deploy/pathplanner/navgrid.json b/src/main/deploy/pathplanner/navgrid.json index 6e83d807..ac5f5216 100644 --- a/src/main/deploy/pathplanner/navgrid.json +++ b/src/main/deploy/pathplanner/navgrid.json @@ -1,2088 +1 @@ -{ - "field_size": { - "x": 15.24, - "y": 8.25 - }, - "nodeSizeMeters": 0.25, - "grid": [ - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ], - [ - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false, - false - ] - ] -} +{"field_size":{"x":16.54,"y":8.07},"nodeSizeMeters":0.3,"grid":[[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]]} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/New Path.path b/src/main/deploy/pathplanner/paths/New Path.path deleted file mode 100644 index 38908444..00000000 --- a/src/main/deploy/pathplanner/paths/New Path.path +++ /dev/null @@ -1,70 +0,0 @@ -{ - "version": "2025.0", - "waypoints": [ - { - "anchor": { - "x": 8.031762295081966, - "y": 6.728227459016393 - }, - "prevControl": null, - "nextControl": { - "x": 6.677151639344262, - "y": 6.728227459016393 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 4.207684426229508, - "y": 6.88406762295082 - }, - "prevControl": { - "x": 5.3096147111058976, - "y": 7.435032765389015 - }, - "nextControl": { - "x": 3.8960040983606556, - "y": 6.728227459016393 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 3.812090163934426, - "y": 5.217776639344262 - }, - "prevControl": { - "x": 3.57233606557377, - "y": 6.728227459016393 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [], - "constraintZones": [], - "pointTowardsZones": [], - "eventMarkers": [], - "globalConstraints": { - "maxVelocity": 3.0, - "maxAcceleration": 3.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, - "unlimited": false - }, - "goalEndState": { - "velocity": 0, - "rotation": -63.43494882292201 - }, - "reversed": false, - "folder": null, - "idealStartingState": { - "velocity": 0, - "rotation": -179.06080905426444 - }, - "useDefaultConstraints": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/lose collecting climb.path b/src/main/deploy/pathplanner/paths/lose collecting climb.path new file mode 100644 index 00000000..f2dad83a --- /dev/null +++ b/src/main/deploy/pathplanner/paths/lose collecting climb.path @@ -0,0 +1,95 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 7.786409952601321, + "y": 1.1764454976293326 + }, + "prevControl": null, + "nextControl": { + "x": 8.075589980201004, + "y": 1.0300009891827078 + }, + "isLocked": true, + "linkedName": "lose collecting end" + }, + { + "anchor": { + "x": 5.454431279620853, + "y": 2.433779620853079 + }, + "prevControl": { + "x": 6.198068133177621, + "y": 2.340066018770411 + }, + "nextControl": { + "x": 3.647707566207364, + "y": 2.661464123500213 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.9720023696682465, + "y": 2.6164691943127956 + }, + "prevControl": { + "x": 3.1452525660392245, + "y": 2.433671737004806 + }, + "nextControl": { + "x": 1.9376429900514227, + "y": 3.7078287915726733 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.4674999999999998, + "y": 3.701860189573459 + }, + "prevControl": { + "x": 1.6461059512272682, + "y": 3.4642957352770187 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.9135638297872317, + "rotationDegrees": -91.50962891206528 + }, + { + "waypointRelativePos": 1.743351063829786, + "rotationDegrees": -90.71356928173023 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 91.54815769897797 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 1.0, + "rotation": -91.25904520717523 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/lose collecting.path b/src/main/deploy/pathplanner/paths/lose collecting.path new file mode 100644 index 00000000..9ac79df1 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/lose collecting.path @@ -0,0 +1,95 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6060426540284354, + "y": 5.560995260663506 + }, + "prevControl": null, + "nextControl": { + "x": 6.307048313048284, + "y": 5.755880238268784 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 5.77682464454445, + "y": 5.700699052131703 + }, + "prevControl": { + "x": 5.483918224952944, + "y": 5.669865584965646 + }, + "nextControl": { + "x": 6.46177947033134, + "y": 5.772802395447242 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.474763033170042, + "y": 7.3556516587667735 + }, + "prevControl": { + "x": 6.562277390657639, + "y": 7.673208781684035 + }, + "nextControl": { + "x": 8.512747947486812, + "y": 6.9944191224230865 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 7.786409952601321, + "y": 1.1764454976293326 + }, + "prevControl": { + "x": 7.532670242876316, + "y": 3.5241380714482045 + }, + "nextControl": null, + "isLocked": true, + "linkedName": "lose collecting end" + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.5625000000000004, + "rotationDegrees": 0.8658502632874043 + }, + { + "waypointRelativePos": 2.2180851063829854, + "rotationDegrees": -88.5493322160677 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 1.0, + "rotation": -91.25904520717523 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 0.7161599454083509 + }, + "useDefaultConstraints": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/win shoot n climb.path b/src/main/deploy/pathplanner/paths/win shoot n climb.path new file mode 100644 index 00000000..7daa99b5 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/win shoot n climb.path @@ -0,0 +1,131 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6490284360189573, + "y": 5.851149289099526 + }, + "prevControl": null, + "nextControl": { + "x": 3.004952544805466, + "y": 7.575751220483924 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.3821090047393362, + "y": 7.162215639810427 + }, + "prevControl": { + "x": 0.44928715407597364, + "y": 7.795609619276372 + }, + "nextControl": { + "x": 0.3068838862568361, + "y": 6.4529502369684595 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.3821090047393362, + "y": 5.657713270143815 + }, + "prevControl": { + "x": 0.38210900474024867, + "y": 6.076824644551397 + }, + "nextControl": { + "x": 0.3821090047377958, + "y": 4.9502428869060235 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.8651184834123224, + "y": 4.9914336492891 + }, + "prevControl": { + "x": 1.5819843890770973, + "y": 5.247339973853388 + }, + "nextControl": { + "x": 2.2914344324655844, + "y": 4.606114643884585 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.2304976303326662, + "y": 4.013507109006374 + }, + "prevControl": { + "x": 2.1980751612820484, + "y": 4.5107750328942835 + }, + "nextControl": { + "x": 2.2616224773239844, + "y": 3.536140995385034 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.5104857819914335, + "y": 3.691113744077464 + }, + "prevControl": { + "x": 1.5357807988591312, + "y": 3.361116937030295 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0.9760638297872352, + "rotationDegrees": -89.91035962462058 + }, + { + "waypointRelativePos": 2.042553191489365, + "rotationDegrees": -88.41355874106513 + }, + { + "waypointRelativePos": 3.090425531914899, + "rotationDegrees": -91.40947522332182 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 90.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -179.31793960682737 + }, + "useDefaultConstraints": true +} \ No newline at end of file From 0c420321e8d3f69815ef7edf9c89b1a33b446054 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 14 Jan 2026 18:48:22 -0500 Subject: [PATCH 015/371] 17 --- src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ src/main/java/frc/robot/rebuilt/Rebuilt.java | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 3143faf5..99524464 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "Rebuilt2026"; + public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 90; - public static final String GIT_SHA = "2ae1dc36c0ff359ddd00d6ad1037a954c455e91b"; - public static final String GIT_DATE = "2026-01-14 17:56:44 EST"; + public static final int GIT_REVISION = 91; + public static final String GIT_SHA = "4a30f016fb22ffee74fed158ce7fc081c670d2f8"; + public static final String GIT_DATE = "2026-01-14 18:41:39 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-14 18:26:28 EST"; - public static final long BUILD_UNIX_TIME = 1768433188098L; + public static final String BUILD_DATE = "2026-01-14 18:42:58 EST"; + public static final long BUILD_UNIX_TIME = 1768434178995L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index dceb3f11..015b4bf7 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -6,6 +6,10 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Intake; +import frc.robot.rebuilt.subsystems.Launcher; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.config.ConfigConstants; @@ -20,10 +24,18 @@ public class Rebuilt extends GenericRobot { GenericDrivetrain drivetrain; PercentControlMotor percentControlMotor; StateMachine stateMachine = new StateMachine("ExampleStateMachine"); + Indexer indexer; + Climb climb; + Intake intake; + Launcher launcher; public Rebuilt(String directory) { super(directory); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); + indexer = new Indexer(); + climb = new Climb(); + intake = new Intake(); + launcher = new Launcher(); } @Override From 4d4cc7f659df995f81496fe414af720b75a18b52 Mon Sep 17 00:00:00 2001 From: Curt Date: Wed, 14 Jan 2026 22:23:14 -0500 Subject: [PATCH 016/371] Refactor subsystem configs and update Intake base class Updated JSON subsystem configs to use explicit device/file objects and correct device types. Added 'type' to intake motor config. Changed Intake.java to extend GenericSubsystem instead of SubsystemBase. Updated BuildConstants with new build metadata. --- src/main/deploy/pathplanner/navgrid.json | 1576 ++++++++++++++++- .../rebuilt_robot/subsystems/climb.json | 7 +- .../rebuilt_robot/subsystems/indexer.json | 10 +- .../rebuilt_robot/subsystems/intake.json | 10 +- .../subsystems/intake/intake.json | 1 + .../rebuilt_robot/subsystems/launcher.json | 15 +- src/main/java/frc/robot/BuildConstants.java | 12 +- .../frc/robot/rebuilt/subsystems/Intake.java | 4 +- 8 files changed, 1616 insertions(+), 19 deletions(-) diff --git a/src/main/deploy/pathplanner/navgrid.json b/src/main/deploy/pathplanner/navgrid.json index ac5f5216..660ca524 100644 --- a/src/main/deploy/pathplanner/navgrid.json +++ b/src/main/deploy/pathplanner/navgrid.json @@ -1 +1,1575 @@ -{"field_size":{"x":16.54,"y":8.07},"nodeSizeMeters":0.3,"grid":[[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true],[true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,true,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,true,true,true,true,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true,true,true,true,true,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]]} \ No newline at end of file +{ + "field_size": { + "x": 16.54, + "y": 8.07 + }, + "nodeSizeMeters": 0.3, + "grid": [ + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + false, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ], + [ + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true, + true + ] + ] +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb.json b/src/main/deploy/rebuilt_robot/subsystems/climb.json index 651395ca..4047ccb7 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb.json @@ -1,8 +1,9 @@ { "devices": { - "percent_motor": "example/percent_motor.json", - "velocity_motor": "example/velocity_motor.json", - "yams_shooter": "example/yams_shooter.json" + "climb_motor": { + "device": "percent_motor", + "file": "climb/climb_motor.json" + } }, "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json index 35daaa3c..77858315 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer.json @@ -1,7 +1,13 @@ { "devices": { - "feeder": "indexer/feeder.json", - "indexer": "indexer/indexer.json" + "feeder": { + "device": "percent_motor", + "file": "indexer/feeder.json" + }, + "indexer": { + "device": "percent_motor", + "file": "indexer/indexer.json" + } }, "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index 59cc228b..1d0653b5 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -1,7 +1,13 @@ { "devices": { - "intake": "intake/intake.json", - "winch": "intake/winch.json" + "intake": { + "device": "percent_motor", + "file": "intake/intake.json" + }, + "winch": { + "device": "yams_elevator", + "file": "intake/winch.json" + } }, "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json index 2ae570d0..e050c433 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json @@ -1,5 +1,6 @@ { "name": "intake_motor", + "type": "Neo", "controller": "spark", "id": 11, "gearing": 1.0, diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json index ad5010cf..4bd2975b 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher.json @@ -1,8 +1,17 @@ { "devices": { - "hood": "launcher/hood.json", - "shooter": "launcher/shooter.json", - "turret": "launcher/turret.json" + "hood": { + "device": "yams_arm", + "file": "launcher/hood.json" + }, + "shooter": { + "device": "yams_shooter", + "file": "launcher/shooter.json" + }, + "turret": { + "device": "yams_pivot", + "file": "launcher/turret.json" + } }, "display": true } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 99524464..c9c561f5 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "rebuilt2026"; + public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 91; - public static final String GIT_SHA = "4a30f016fb22ffee74fed158ce7fc081c670d2f8"; - public static final String GIT_DATE = "2026-01-14 18:41:39 EST"; + public static final int GIT_REVISION = 96; + public static final String GIT_SHA = "5004ea0cc08842391c28f89127465754e609a4cc"; + public static final String GIT_DATE = "2026-01-14 22:13:54 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-14 18:42:58 EST"; - public static final long BUILD_UNIX_TIME = 1768434178995L; + public static final String BUILD_DATE = "2026-01-14 22:20:33 EST"; + public static final long BUILD_UNIX_TIME = 1768447233455L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java index 63194bc0..8029bec4 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java @@ -4,9 +4,9 @@ package frc.robot.rebuilt.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.frc5010.common.arch.GenericSubsystem; -public class Intake extends SubsystemBase { +public class Intake extends GenericSubsystem { /** Creates a new Intake. */ public Intake() { super("intake.json"); From 232ab29fba04874aede12589636fdc0cec96419a Mon Sep 17 00:00:00 2001 From: Curt Date: Fri, 16 Jan 2026 12:55:35 -0500 Subject: [PATCH 017/371] Refactor subsystem device definitions to array format Updated climb, indexer, intake, and launcher subsystem JSON files to use an array for the 'devices' field instead of an object. Modified robots.json to add 'rebuilt_robot' entry and updated simulation and competition flags for 'tigershark'. --- src/main/deploy/rebuilt_robot/subsystems/climb.json | 6 +++--- src/main/deploy/rebuilt_robot/subsystems/indexer.json | 8 ++++---- src/main/deploy/rebuilt_robot/subsystems/intake.json | 8 ++++---- src/main/deploy/rebuilt_robot/subsystems/launcher.json | 10 +++++----- src/main/deploy/robots.json | 10 ++++++++-- 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb.json b/src/main/deploy/rebuilt_robot/subsystems/climb.json index 4047ccb7..79ed207a 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb.json @@ -1,9 +1,9 @@ { - "devices": { - "climb_motor": { + "devices": [ + { "device": "percent_motor", "file": "climb/climb_motor.json" } - }, + ], "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json index 77858315..5745728e 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer.json @@ -1,13 +1,13 @@ { - "devices": { - "feeder": { + "devices": [ + { "device": "percent_motor", "file": "indexer/feeder.json" }, - "indexer": { + { "device": "percent_motor", "file": "indexer/indexer.json" } - }, + ], "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index 1d0653b5..3e4ef721 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -1,13 +1,13 @@ { - "devices": { - "intake": { + "devices": [ + { "device": "percent_motor", "file": "intake/intake.json" }, - "winch": { + { "device": "yams_elevator", "file": "intake/winch.json" } - }, + ], "display": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json index 4bd2975b..17da4732 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher.json @@ -1,17 +1,17 @@ { - "devices": { - "hood": { + "devices": [ + { "device": "yams_arm", "file": "launcher/hood.json" }, - "shooter": { + { "device": "yams_shooter", "file": "launcher/shooter.json" }, - "turret": { + { "device": "yams_pivot", "file": "launcher/turret.json" } - }, + ], "display": true } diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index 011f9cb9..454e57b6 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -9,14 +9,20 @@ "tigershark": { "id": "00:80:2F:38:90:61", "robotClass": "frc.robot.tigershark.TigerShark", - "simulate": true, - "competition": true + "simulate": false, + "competition": false }, "alpha": { "id": "alpha", "robotClass": "frc.robot.alpha.Alpha", "simulate": false }, + "rebuilt_robot": { + "id": "TBD", + "robotClass": "frc.robot.rebuilt.Rebuilt", + "simulate": true, + "competition": true + }, "baby_swerve": { "id": "00:80:2F:24:6D:74", "robotClass": "frc.robot.baby_swerve.BabySwerve", From 3919f7cb894b0805b3e3ea406557b049ae2545d8 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Fri, 16 Jan 2026 18:22:13 -0500 Subject: [PATCH 018/371] Create PreloadDepotClimb.path --- .../pathplanner/paths/PreloadDepotClimb.path | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/main/deploy/pathplanner/paths/PreloadDepotClimb.path diff --git a/src/main/deploy/pathplanner/paths/PreloadDepotClimb.path b/src/main/deploy/pathplanner/paths/PreloadDepotClimb.path new file mode 100644 index 00000000..68bb1e54 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/PreloadDepotClimb.path @@ -0,0 +1,75 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.5991440798858774, + "y": 7.4702139800285305 + }, + "prevControl": null, + "nextControl": { + "x": 2.473480741797431, + "y": 7.366704707560627 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.6232524964336661, + "y": 6.978544935805992 + }, + "prevControl": { + "x": 0.7386209078030369, + "y": 7.238123861387076 + }, + "nextControl": { + "x": -0.20482168330955786, + "y": 5.115378031383738 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.5418972895863048, + "y": 4.054407988587732 + }, + "prevControl": { + "x": 1.8912410841654772, + "y": 5.5811697574893016 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.15, + "rotationDegrees": -90.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": false +} \ No newline at end of file From 44e8cd6dd3e5116fa29305ac4aaf168e942d132b Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Fri, 16 Jan 2026 18:25:23 -0500 Subject: [PATCH 019/371] OupostClimbAuto Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- .../deploy/pathplanner/autos/New Auto.auto | 19 ++++ .../pathplanner/autos/New New Auto.auto | 19 ++++ .../pathplanner/autos/OutpostClimb.auto | 25 +++++ .../pathplanner/paths/OutpostToClimb.path | 59 ++++++++++++ .../paths/RightStartToOutPost.path | 54 +++++++++++ .../pathplanner/paths/WinDepotCollection.path | 95 +++++++++++++++++++ .../pathplanner/paths/win shoot n climb.path | 4 +- src/main/deploy/pathplanner/settings.json | 4 +- 8 files changed, 275 insertions(+), 4 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/New Auto.auto create mode 100644 src/main/deploy/pathplanner/autos/New New Auto.auto create mode 100644 src/main/deploy/pathplanner/autos/OutpostClimb.auto create mode 100644 src/main/deploy/pathplanner/paths/OutpostToClimb.path create mode 100644 src/main/deploy/pathplanner/paths/RightStartToOutPost.path create mode 100644 src/main/deploy/pathplanner/paths/WinDepotCollection.path diff --git a/src/main/deploy/pathplanner/autos/New Auto.auto b/src/main/deploy/pathplanner/autos/New Auto.auto new file mode 100644 index 00000000..7c89d751 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/New Auto.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "win shoot n climb" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/New New Auto.auto b/src/main/deploy/pathplanner/autos/New New Auto.auto new file mode 100644 index 00000000..e51a5ee2 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/New New Auto.auto @@ -0,0 +1,19 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": null + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/OutpostClimb.auto b/src/main/deploy/pathplanner/autos/OutpostClimb.auto new file mode 100644 index 00000000..0e6b51e8 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/OutpostClimb.auto @@ -0,0 +1,25 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "RightStartToOutPost" + } + }, + { + "type": "path", + "data": { + "pathName": "OutpostToClimb" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/OutpostToClimb.path b/src/main/deploy/pathplanner/paths/OutpostToClimb.path new file mode 100644 index 00000000..aefa6c00 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/OutpostToClimb.path @@ -0,0 +1,59 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 0.4058977272698341, + "y": 0.696 + }, + "prevControl": null, + "nextControl": { + "x": 0.895317606732138, + "y": 1.7975139625182095 + }, + "isLocked": false, + "linkedName": "Outpost" + }, + { + "anchor": { + "x": 1.5705681818181816, + "y": 3.272295454545455 + }, + "prevControl": { + "x": 1.7045568181839084, + "y": 2.9424772727247968 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 0, + "rotationDegrees": 0.0 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 0.0 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 178.22567592497847 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/RightStartToOutPost.path b/src/main/deploy/pathplanner/paths/RightStartToOutPost.path new file mode 100644 index 00000000..a85ac843 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/RightStartToOutPost.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6113181818181816, + "y": 0.696 + }, + "prevControl": null, + "nextControl": { + "x": 2.291262298271808, + "y": 0.6914440719587504 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.4058977272698341, + "y": 0.696 + }, + "prevControl": { + "x": 1.3255191513546358, + "y": 0.6925385978972312 + }, + "nextControl": null, + "isLocked": false, + "linkedName": "Outpost" + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": 178.22567592497847 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": 180.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/WinDepotCollection.path b/src/main/deploy/pathplanner/paths/WinDepotCollection.path new file mode 100644 index 00000000..fde18db8 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/WinDepotCollection.path @@ -0,0 +1,95 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.621625, + "y": 7.312568181818182 + }, + "prevControl": null, + "nextControl": { + "x": 2.329191355829282, + "y": 7.158910831742364 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.570806818181818, + "y": 6.913815566835872 + }, + "prevControl": { + "x": 2.3194585448443883, + "y": 7.151243654822869 + }, + "nextControl": { + "x": 0.2699963185598927, + "y": 6.872972178365397 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.570806818181818, + "y": 5.302738636363637 + }, + "prevControl": { + "x": 0.34539447131540213, + "y": 5.410855581752298 + }, + "nextControl": { + "x": 1.0642918357641027, + "y": 5.066043116185743 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.5478172588832488, + "y": 3.916285956006769 + }, + "prevControl": { + "x": 1.9950951337450644, + "y": 4.988433854149118 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [ + { + "waypointRelativePos": 1.1240105540897112, + "rotationDegrees": -90.20303132115124 + }, + { + "waypointRelativePos": 1.8364116094986804, + "rotationDegrees": -89.68793512227258 + } + ], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -0.5273342937200357 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0, + "rotation": -90.0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/win shoot n climb.path b/src/main/deploy/pathplanner/paths/win shoot n climb.path index 7daa99b5..e940c6fc 100644 --- a/src/main/deploy/pathplanner/paths/win shoot n climb.path +++ b/src/main/deploy/pathplanner/paths/win shoot n climb.path @@ -20,7 +20,7 @@ "y": 7.162215639810427 }, "prevControl": { - "x": 0.44928715407597364, + "x": 0.4492871540759737, "y": 7.795609619276372 }, "nextControl": { @@ -99,7 +99,7 @@ }, { "waypointRelativePos": 2.042553191489365, - "rotationDegrees": -88.41355874106513 + "rotationDegrees": -88.41355874106515 }, { "waypointRelativePos": 3.090425531914899, diff --git a/src/main/deploy/pathplanner/settings.json b/src/main/deploy/pathplanner/settings.json index 7642c343..8f0f6595 100644 --- a/src/main/deploy/pathplanner/settings.json +++ b/src/main/deploy/pathplanner/settings.json @@ -9,7 +9,7 @@ "defaultMaxAngVel": 540.0, "defaultMaxAngAccel": 720.0, "defaultNominalVoltage": 12.0, - "robotMass": 40.0, + "robotMass": 58.927, "robotMOI": 6.883, "robotTrackwidth": 0.546, "driveWheelRadius": 0.1016, @@ -31,4 +31,4 @@ "robotFeatures": [ "{\"name\":\"Rectangle\",\"type\":\"rounded_rect\",\"data\":{\"center\":{\"x\":0.3,\"y\":0.0},\"size\":{\"width\":0.2,\"length\":0.2},\"borderRadius\":0.05,\"strokeWidth\":0.02,\"filled\":true}}" ] -} +} \ No newline at end of file From dc1ad1afcd8da6926b7881a64208787d81f8881d Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Fri, 16 Jan 2026 18:39:41 -0500 Subject: [PATCH 020/371] Refactor indexer and intake subsystems, update configs Replaces indexer and intake device configs with new 'spindexer' and 'spintake' JSON files, updates references in subsystem JSONs, and removes old indexer config. Refactors Indexer and Intake Java classes to use new device names, adds controller bindings and command methods for both subsystems. Updates simgui.json for new devices and makes minor adjustments to feeder config. Also updates BuildConstants and enables controller configuration in Rebuilt.java. --- simgui.json | 28 +++++++--- .../rebuilt_robot/subsystems/indexer.json | 2 +- .../subsystems/indexer/feeder.json | 15 ++---- .../subsystems/indexer/indexer.json | 18 ------- .../subsystems/indexer/spindexer.json | 11 ++++ .../rebuilt_robot/subsystems/intake.json | 2 +- .../intake/{intake.json => spintake.json} | 2 +- src/main/java/frc/robot/BuildConstants.java | 10 ++-- src/main/java/frc/robot/rebuilt/Rebuilt.java | 5 +- .../frc/robot/rebuilt/subsystems/Indexer.java | 54 ++++++++++++++++++- .../frc/robot/rebuilt/subsystems/Intake.java | 31 +++++++++-- 11 files changed, 129 insertions(+), 49 deletions(-) delete mode 100644 src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json create mode 100644 src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json rename src/main/deploy/rebuilt_robot/subsystems/intake/{intake.json => spintake.json} (84%) diff --git a/simgui.json b/simgui.json index 291d7b75..27de1f20 100644 --- a/simgui.json +++ b/simgui.json @@ -10,6 +10,21 @@ } }, "Other Devices": { + "SPARK MAX [10]": { + "header": { + "open": true + } + }, + "SPARK MAX [11]": { + "header": { + "open": true + } + }, + "SPARK MAX [11] RELATIVE ENCODER": { + "header": { + "open": true + } + }, "SPARK MAX [5]": { "header": { "open": true @@ -20,27 +35,27 @@ "open": true } }, - "Talon FX (v6)[12]": { + "SPARK MAX [9]": { "header": { "open": true } }, - "Talon FX (v6)[12]/Fwd Limit": { + "Talon FX (v6)[12]": { "header": { "open": true } }, - "Talon FX (v6)[12]/Rev Limit": { + "Talon FX (v6)[12]/Fwd Limit": { "header": { "open": true } }, - "Talon FX (v6)[12]/Rotor Sensor": { + "Talon FX (v6)[12]/Rev Limit": { "header": { "open": true } }, - "Talon FX (v6)[2]/Rotor Sensor": { + "Talon FX (v6)[12]/Rotor Sensor": { "header": { "open": true } @@ -122,7 +137,8 @@ "/SmartDashboard/VisionSystemSim-Vision/Sim Field": "Field2d", "/SmartDashboard/VisionSystemSim-main/Sim Field": "Field2d", "/SmartDashboard/navX-Sensor[1]": "Gyro", - "/SmartDashboard/navX-Sensor[4]": "Gyro" + "/SmartDashboard/navX-Sensor[4]": "Gyro", + "/SmartDashboard/winch_motor/mechanism": "Mechanism2d" }, "windows": { "/FMSInfo": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json index 5745728e..d5d1a074 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer.json @@ -6,7 +6,7 @@ }, { "device": "percent_motor", - "file": "indexer/indexer.json" + "file": "indexer/spindexer.json" } ], "display": true diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json index fdef190c..39f9e825 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json @@ -1,17 +1,10 @@ { - "name": "feeder_motor", + "name": "feeder", "controller": "spark", - "type": "neo", + "type": "Neo", "id": 9, "gearing": 1.0, - "x": -0.25, + "x": -0.40, "y": 0.0, - "z": 0.25, - "kP": 0.1, - "kI": 0.0, - "kD": 0.01, - "iZone": 0.0, - "kS": 0.1, - "kV": 0.1, - "kA": 0.0 + "z": 0.10 } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json deleted file mode 100644 index cd57fa0d..00000000 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/indexer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "indexer_motor", - "controller": "spark", - "type": "Neo", - "id": 10, - "gearing": 1.0, - "momentOfInertiaKgMSq": 1.0, - "x": -0.25, - "y": 0.0, - "z": 0.25, - "kP": 0.1, - "kI": 0.0, - "kD": 0.01, - "iZone": 0.0, - "kS": 0.1, - "kV": 0.1, - "kA": 0.0 -} diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json new file mode 100644 index 00000000..3ae85b0b --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json @@ -0,0 +1,11 @@ +{ + "name": "spindexer", + "controller": "spark", + "type": "Neo", + "id": 10, + "gearing": 1.0, + "momentOfInertiaKgMSq": 1.0, + "x": -0.05, + "y": 0.0, + "z": 0.1 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index 3e4ef721..b9f6ab6f 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -2,7 +2,7 @@ "devices": [ { "device": "percent_motor", - "file": "intake/intake.json" + "file": "intake/spintake.json" }, { "device": "yams_elevator", diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json similarity index 84% rename from src/main/deploy/rebuilt_robot/subsystems/intake/intake.json rename to src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json index e050c433..c214de94 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json @@ -1,5 +1,5 @@ { - "name": "intake_motor", + "name": "spintake", "type": "Neo", "controller": "spark", "id": 11, diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index df9477d2..5f32fd23 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 71; - public static final String GIT_SHA = "29dabbcd95f177097ec91cc371950f5e9efdb899"; - public static final String GIT_DATE = "2026-01-12 17:30:35 EST"; + public static final int GIT_REVISION = 106; + public static final String GIT_SHA = "232ab29fba04874aede12589636fdc0cec96419a"; + public static final String GIT_DATE = "2026-01-16 12:55:35 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-12 18:54:29 EST"; - public static final long BUILD_UNIX_TIME = 1768262069859L; + public static final String BUILD_DATE = "2026-01-16 18:13:57 EST"; + public static final long BUILD_UNIX_TIME = 1768605237191L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 015b4bf7..523e80ab 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -39,7 +39,10 @@ public Rebuilt(String directory) { } @Override - public void configureButtonBindings(Controller driver, Controller operator) {} + public void configureButtonBindings(Controller driver, Controller operator) { + indexer.ConfigController(driver); + intake.ConfigController(driver); + } @Override public void setupDefaultCommands(Controller driver, Controller operator) {} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java index 854c75d8..c267c2d9 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java @@ -4,16 +4,66 @@ package frc.robot.rebuilt.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.motors.function.PercentControlMotor; +import org.frc5010.common.sensors.Controller; + +public class Indexer extends GenericSubsystem { + private PercentControlMotor Spindexer; + private PercentControlMotor Feeder; -public class Indexer extends SubsystemBase { /** Creates a new Index. */ public Indexer() { super("indexer.json"); + Spindexer = (PercentControlMotor) devices.get("spindexer"); + Feeder = (PercentControlMotor) devices.get("feeder"); + } + + public void RunSpindexer(double speed) { + Spindexer.set(speed); + } + + public void RunFeeder(double speed) { + Feeder.set(speed); + } + + public void ConfigController(Controller controller) { + controller.createXButton().whileTrue(spindexerCommand(.25)); + controller.createYButton().whileTrue(feederCommand(.25)); + } + + public Command feederCommand(double speed) { + return Commands.run( + () -> { + RunFeeder(0.25); + }) + .finallyDo( + () -> { + RunFeeder(0); + }); + } + + public Command spindexerCommand(double speed) { + return Commands.run( + () -> { + RunSpindexer(0.25); + }) + .finallyDo( + () -> { + RunSpindexer(0); + }); } @Override public void periodic() { // This method will be called once per scheduler run + super.periodic(); + } + + @Override + public void simulationPeriodic() { + super.simulationPeriodic(); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java index 8029bec4..5a4da807 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java @@ -5,15 +5,40 @@ package frc.robot.rebuilt.subsystems; import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.motors.function.PercentControlMotor; +import org.frc5010.common.sensors.Controller; + +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; public class Intake extends GenericSubsystem { + private PercentControlMotor Spintake; + /** Creates a new Intake. */ public Intake() { super("intake.json"); + Spintake = (PercentControlMotor) devices.get("spintake"); + } + + public void RunSpintake(double speed) { + Spintake.set(speed); + } + + public void ConfigController(Controller controller) { + controller + .createAButton() + .whileTrue(spintakeCommand(.25)); + } - @Override - public void periodic() { - // This method will be called once per scheduler run + public Command spintakeCommand(double speed) { + return Commands.run( + () -> { + RunSpintake(.25); + }) + .finallyDo( + () -> { + RunSpintake(0); + }); } } From 2f63d85e0e2f3b4e30c6e0de6a108f51951c2a94 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Fri, 16 Jan 2026 19:04:43 -0500 Subject: [PATCH 021/371] Update to 2026.2.1 --- .vscode/settings.json | 2 +- build.gradle | 2 +- src/main/deploy/pathplanner/settings.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8328c83c..7be76ce3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -163,5 +163,5 @@ "url": "./src/main/resources/schemas/yams-shooter.schema.json" } ], - "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable" + "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx4G -Xms100m -Xlog:disable" } diff --git a/build.gradle b/build.gradle index 2651d04f..9fef7162 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "java" - id "edu.wpi.first.GradleRIO" version "2026.1.1" + id "edu.wpi.first.GradleRIO" version "2026.2.1" id "com.peterabeles.gversion" version "1.10" id "com.diffplug.spotless" version "6.12.0" } diff --git a/src/main/deploy/pathplanner/settings.json b/src/main/deploy/pathplanner/settings.json index 8f0f6595..252d44c3 100644 --- a/src/main/deploy/pathplanner/settings.json +++ b/src/main/deploy/pathplanner/settings.json @@ -31,4 +31,4 @@ "robotFeatures": [ "{\"name\":\"Rectangle\",\"type\":\"rounded_rect\",\"data\":{\"center\":{\"x\":0.3,\"y\":0.0},\"size\":{\"width\":0.2,\"length\":0.2},\"borderRadius\":0.05,\"strokeWidth\":0.02,\"filled\":true}}" ] -} \ No newline at end of file +} From 56904e688adbd961a60eb363a935aafd0a68a884 Mon Sep 17 00:00:00 2001 From: 5010 FHS 6 Date: Sat, 17 Jan 2026 13:51:07 -0500 Subject: [PATCH 022/371] Cleanup problem issues displayed in VSS editor. --- .../frc5010/common/auto/pathplanner/PathFinderCommand.java | 4 ++-- .../java/org/frc5010/common/commands/DefaultDriveCommand.java | 1 - src/main/java/org/frc5010/common/commands/DriveByAngle.java | 1 - .../java/org/frc5010/common/commands/DriveToPoseSupplier.java | 4 ++-- .../java/org/frc5010/common/commands/LedDefaultCommand.java | 2 +- .../org/frc5010/common/sensors/encoder/CanCoderEncoder.java | 3 +-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/frc5010/common/auto/pathplanner/PathFinderCommand.java b/src/main/java/org/frc5010/common/auto/pathplanner/PathFinderCommand.java index 789e57fc..545652c5 100644 --- a/src/main/java/org/frc5010/common/auto/pathplanner/PathFinderCommand.java +++ b/src/main/java/org/frc5010/common/auto/pathplanner/PathFinderCommand.java @@ -50,7 +50,7 @@ public class PathFinderCommand extends Command { private final PathFollowingController controller; private final RobotConfig robotConfig; private final BooleanSupplier shouldFlipPath; - private boolean pregeneratedPath = false; + // private boolean pregeneratedPath = false; private static PathPlannerTrajectory trajPregen; private static PathPlannerPath pathPregen; @@ -447,7 +447,7 @@ public boolean isFinished() { @Override public void end(boolean interrupted) { CommandRunning = false; - pregeneratedPath = false; + // pregeneratedPath = false; timer.stop(); // Only output 0 speeds when ending a path that is supposed to stop, this allows interrupting diff --git a/src/main/java/org/frc5010/common/commands/DefaultDriveCommand.java b/src/main/java/org/frc5010/common/commands/DefaultDriveCommand.java index 985e6643..90c554a9 100644 --- a/src/main/java/org/frc5010/common/commands/DefaultDriveCommand.java +++ b/src/main/java/org/frc5010/common/commands/DefaultDriveCommand.java @@ -15,7 +15,6 @@ /** A default driving command */ public class DefaultDriveCommand extends Command { - // TODO: Understand code private final GenericDrivetrain drivetrainSubsystem; private final DoubleSupplier m_translationXSupplier; diff --git a/src/main/java/org/frc5010/common/commands/DriveByAngle.java b/src/main/java/org/frc5010/common/commands/DriveByAngle.java index 389c0707..8566306c 100644 --- a/src/main/java/org/frc5010/common/commands/DriveByAngle.java +++ b/src/main/java/org/frc5010/common/commands/DriveByAngle.java @@ -14,7 +14,6 @@ /** Drive the robot where the angle is given */ public class DriveByAngle extends Command { - // TODO: Understand code /** The subsystem used by this command. */ private final GenericDrivetrain drivetrainSubsystem; diff --git a/src/main/java/org/frc5010/common/commands/DriveToPoseSupplier.java b/src/main/java/org/frc5010/common/commands/DriveToPoseSupplier.java index 24b552c7..7971c87d 100644 --- a/src/main/java/org/frc5010/common/commands/DriveToPoseSupplier.java +++ b/src/main/java/org/frc5010/common/commands/DriveToPoseSupplier.java @@ -77,8 +77,8 @@ public class DriveToPoseSupplier extends GenericCommand { private Translation2d lastSetpointTranslation = Translation2d.kZero; private Rotation2d lastSetpointRotation = Rotation2d.kZero; private double lastTime = 0.0; - private double driveErrorAbs = 0.0; - private double thetaErrorAbs = 0.0; + // private double driveErrorAbs = 0.0; + // private double thetaErrorAbs = 0.0; private double speedTowardsTarget = 0.0; private Translation2d currentVelocity = new Translation2d(); private double previousTime = 0.0, deltaTime = 0.0; diff --git a/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java b/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java index c2726b4a..f9a1ec5b 100644 --- a/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java +++ b/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java @@ -11,7 +11,7 @@ public class LedDefaultCommand extends Command { /** Creates a new LedDefaultCommand. */ LedSubsystem ledSubsystem; - private int currDelay = 200; + //private int currDelay = 200; private boolean lastState; public LedDefaultCommand(LedSubsystem ledSubsystem) { diff --git a/src/main/java/org/frc5010/common/sensors/encoder/CanCoderEncoder.java b/src/main/java/org/frc5010/common/sensors/encoder/CanCoderEncoder.java index 26869438..c3d4c0d2 100644 --- a/src/main/java/org/frc5010/common/sensors/encoder/CanCoderEncoder.java +++ b/src/main/java/org/frc5010/common/sensors/encoder/CanCoderEncoder.java @@ -4,7 +4,6 @@ package org.frc5010.common.sensors.encoder; -import com.ctre.phoenix6.configs.CANcoderConfiguration; import com.ctre.phoenix6.hardware.CANcoder; import edu.wpi.first.math.util.Units; import java.util.Optional; @@ -21,7 +20,7 @@ public class CanCoderEncoder implements GenericEncoder { */ public CanCoderEncoder(int CanID) { this.canCoder = new CANcoder(CanID); - CANcoderConfiguration config = new CANcoderConfiguration(); + // CANcoderConfiguration config = new CANcoderConfiguration(); // config.absoluteSensorRange = AbsoluteSensorRange.Signed_PlusMinus180; // config.sensorCoefficient = 360.0 / 4096.0; // config.unitString = "degrees"; From 15e174c27012aa1da631fd5a3459091447151644 Mon Sep 17 00:00:00 2001 From: Your Name <162905778+AkhilPalukuru@users.noreply.github.com> Date: Sat, 17 Jan 2026 15:38:02 -0500 Subject: [PATCH 023/371] Add climb subsystem with elevator control and config Introduces a new climb subsystem using an Elevator mechanism, including configuration files and controller bindings. Updates simgui.json for new devices and dashboard elements, modifies climb.json to use yams_elevator, and adds climb_motor.json with elevator parameters. Refactors Climb.java to support height commands and controller integration, and updates GenericSubsystem with a setHeight stub. Also updates Intake controller mapping and build metadata. --- simgui.json | 83 +++++++++++++------ .../rebuilt_robot/subsystems/climb.json | 2 +- .../subsystems/climb/climb_motor.json | 59 +++++++++++++ src/main/java/frc/robot/BuildConstants.java | 12 +-- src/main/java/frc/robot/rebuilt/Rebuilt.java | 1 + .../frc/robot/rebuilt/subsystems/Climb.java | 35 ++++++-- .../frc/robot/rebuilt/subsystems/Intake.java | 16 ++-- .../frc5010/common/arch/GenericSubsystem.java | 6 ++ 8 files changed, 168 insertions(+), 46 deletions(-) create mode 100644 src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json diff --git a/simgui.json b/simgui.json index 27de1f20..7f27a512 100644 --- a/simgui.json +++ b/simgui.json @@ -10,6 +10,11 @@ } }, "Other Devices": { + "CANcoder (v6)[16]": { + "header": { + "open": true + } + }, "SPARK MAX [10]": { "header": { "open": true @@ -25,6 +30,31 @@ "open": true } }, + "SPARK MAX [12]": { + "header": { + "open": true + } + }, + "SPARK MAX [13]": { + "header": { + "open": true + } + }, + "SPARK MAX [13] RELATIVE ENCODER": { + "header": { + "open": true + } + }, + "SPARK MAX [16]": { + "header": { + "open": true + } + }, + "SPARK MAX [16] RELATIVE ENCODER": { + "header": { + "open": true + } + }, "SPARK MAX [5]": { "header": { "open": true @@ -65,6 +95,11 @@ "open": true } }, + "Talon FX (v6)[8]": { + "header": { + "open": true + } + }, "Talon FX[50]": { "header": { "open": true @@ -109,6 +144,7 @@ "/SmartDashboard/Alpha/Auto Modes": "String Chooser", "/SmartDashboard/Arm/mechanism": "Mechanism2d", "/SmartDashboard/Auto Modes": "String Chooser", + "/SmartDashboard/Climb/mechanism": "Mechanism2d", "/SmartDashboard/Drive Visual": "Mechanism2d", "/SmartDashboard/DrivePoseEstimator/Pose Field": "Field2d", "/SmartDashboard/Elevator/mechanism": "Mechanism2d", @@ -117,6 +153,10 @@ "/SmartDashboard/Field": "Field2d", "/SmartDashboard/IMU": "Alerts", "/SmartDashboard/JSON": "Alerts", + "/SmartDashboard/Mechanisms/Commands/ElevatorMotor/Down": "Command", + "/SmartDashboard/Mechanisms/Commands/ElevatorMotor/Up": "Command", + "/SmartDashboard/Mechanisms/Commands/ElevatorMotor/ZeroEncoder": "Command", + "/SmartDashboard/Mechanisms/Commands/climb.json/Live Tuning": "Command", "/SmartDashboard/Mechanisms/Shooter/ShooterMotor/Commands/Down": "Command", "/SmartDashboard/Mechanisms/Shooter/ShooterMotor/Commands/LiveTuning": "Command", "/SmartDashboard/Mechanisms/Shooter/ShooterMotor/Commands/Up": "Command", @@ -146,7 +186,7 @@ "visible": true } }, - "/SmartDashboard/Arm/mechanism": { + "/SmartDashboard/Climb/mechanism": { "window": { "visible": true } @@ -672,12 +712,12 @@ "arrowWeight": 3.0, "style": "Hidden" }, - "bottom": 1638, - "height": 8.051901817321777, - "left": 534, - "right": 3466, - "top": 291, - "width": 17.54825210571289, + "bottom": 1914, + "height": 8.069275856018066, + "left": 245, + "right": 3942, + "top": 118, + "width": 16.54119300842285, "window": { "visible": true } @@ -707,12 +747,12 @@ "arrowWeight": 3.0, "style": "Hidden" }, - "bottom": 1638, - "height": 8.051901817321777, - "left": 534, - "right": 3466, - "top": 291, - "width": 17.54825210571289, + "bottom": 1914, + "height": 8.069275856018066, + "left": 245, + "right": 3942, + "top": 118, + "width": 16.54119300842285, "window": { "visible": true } @@ -727,23 +767,18 @@ "visible": true } }, - "/SmartDashboard/Shooter/mechanism": { - "window": { - "visible": true - } - }, "/SmartDashboard/TigerShark/Auto Modes": { "window": { "visible": true } }, "/SmartDashboard/VisionSystemSim-main/Sim Field": { - "bottom": 1638, - "height": 8.051901817321777, - "left": 534, - "right": 3466, - "top": 291, - "width": 17.54825210571289, + "bottom": 1914, + "height": 8.069275856018066, + "left": 245, + "right": 3942, + "top": 118, + "width": 16.54119300842285, "window": { "visible": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb.json b/src/main/deploy/rebuilt_robot/subsystems/climb.json index 79ed207a..84169478 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb.json @@ -1,7 +1,7 @@ { "devices": [ { - "device": "percent_motor", + "device": "yams_elevator", "file": "climb/climb_motor.json" } ], diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json new file mode 100644 index 00000000..f47af100 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json @@ -0,0 +1,59 @@ +{ + "motorSetup": { + "name": "Climb", + "controllerType": "spark", + "motorType": "Neo", + "canId": 16 + }, + "motorSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "OPEN_LOOP" + }, + "sprocketTeeth": 22, + "lowerSoftLimit": { + "val": 0.1, + "uom": "m" + }, + "upperSoftLimit": { + "val": 2, + "uom": "m" + }, + "lowerHardLimit": { + "val": 0.1, + "uom": "m" + }, + "upperHardLimit": { + "val": 3, + "uom": "m" + }, + "gearing": [ + 3, + 4 + ], + "startingPosition": { + "val": 0.5, + "uom": "m" + }, + "mass": { + "val": 16, + "uom": "lbs" + } +} diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 5f32fd23..db1233c7 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "Rebuilt2026"; + public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 106; - public static final String GIT_SHA = "232ab29fba04874aede12589636fdc0cec96419a"; - public static final String GIT_DATE = "2026-01-16 12:55:35 EST"; + public static final int GIT_REVISION = 110; + public static final String GIT_SHA = "2f63d85e0e2f3b4e30c6e0de6a108f51951c2a94"; + public static final String GIT_DATE = "2026-01-16 19:04:43 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-16 18:13:57 EST"; - public static final long BUILD_UNIX_TIME = 1768605237191L; + public static final String BUILD_DATE = "2026-01-17 15:31:38 EST"; + public static final long BUILD_UNIX_TIME = 1768681898097L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 523e80ab..95f0e57c 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -42,6 +42,7 @@ public Rebuilt(String directory) { public void configureButtonBindings(Controller driver, Controller operator) { indexer.ConfigController(driver); intake.ConfigController(driver); + climb.ConfigController(driver); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java index 1b65dd8e..7a0a5e4b 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb.java @@ -4,16 +4,41 @@ package frc.robot.rebuilt.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import static edu.wpi.first.units.Units.Meters; -public class Climb extends SubsystemBase { +import edu.wpi.first.units.measure.Distance; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; +import yams.mechanisms.positional.Elevator; + +public class Climb extends GenericSubsystem { /** Creates a new Climb. */ + private static Elevator climber; + + public Command climberCommand(double height) { + return Commands.run( + () -> { + setHeight(height); + }) + .finallyDo( + () -> { + setHeight(0); + }); + } + + public void ConfigController(Controller controller) { + controller.createBButton().whileTrue(climberCommand(.5)); + } + public Climb() { super("climb.json"); + climber = (Elevator) devices.get("Climb"); } - @Override - public void periodic() { - // This method will be called once per scheduler run + public void setHeight(double height) { + Distance mydist = Meters.of(height); + climber.getMotorController().setPosition(mydist); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java index 5a4da807..250fd44b 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Intake.java @@ -4,13 +4,12 @@ package frc.robot.rebuilt.subsystems; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; - public class Intake extends GenericSubsystem { private PercentControlMotor Spintake; @@ -25,17 +24,14 @@ public void RunSpintake(double speed) { } public void ConfigController(Controller controller) { - controller - .createAButton() - .whileTrue(spintakeCommand(.25)); - + controller.createLeftBumper().whileTrue(spintakeCommand(.25)); } public Command spintakeCommand(double speed) { return Commands.run( - () -> { - RunSpintake(.25); - }) + () -> { + RunSpintake(.25); + }) .finallyDo( () -> { RunSpintake(0); diff --git a/src/main/java/org/frc5010/common/arch/GenericSubsystem.java b/src/main/java/org/frc5010/common/arch/GenericSubsystem.java index 95a44359..e635b338 100644 --- a/src/main/java/org/frc5010/common/arch/GenericSubsystem.java +++ b/src/main/java/org/frc5010/common/arch/GenericSubsystem.java @@ -4,6 +4,7 @@ package org.frc5010.common.arch; +import edu.wpi.first.units.measure.Distance; import edu.wpi.first.util.sendable.SendableBuilder; import edu.wpi.first.wpilibj.Alert; import edu.wpi.first.wpilibj.Alert.AlertType; @@ -172,4 +173,9 @@ public DisplayValuesHelper getDisplayValuesHelper() { public void setDisplay(boolean display) { if (display) DashBoard.makeDisplayed(); } + + public static Object setHeight(Distance of) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'setHeight'"); + } } From cbcf21e28bc583d530862cf092144bcdd3814b31 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 19 Jan 2026 18:58:47 -0500 Subject: [PATCH 024/371] Alpha bot configured --- src/main/deploy/alpha/drive_modules/backleft.json | 5 ----- src/main/deploy/alpha/drive_modules/backright.json | 5 ----- src/main/deploy/alpha/drive_modules/frontleft.json | 5 ----- .../deploy/alpha/drive_modules/frontright.json | 5 ----- src/main/deploy/alpha/robot.json | 4 ++-- src/main/deploy/alpha/yagsl_drivetrain.json | 2 +- .../alpha/yagsl_swerve/modules/backleft.json | 12 ++++++------ .../alpha/yagsl_swerve/modules/backright.json | 10 +++++----- .../alpha/yagsl_swerve/modules/frontleft.json | 10 +++++----- .../alpha/yagsl_swerve/modules/frontright.json | 12 ++++++------ .../yagsl_swerve/modules/physicalproperties.json | 6 +++--- .../alpha/yagsl_swerve/modules/pidfproperties.json | 14 +++++++------- .../deploy/alpha/yagsl_swerve/swervedrive.json | 2 +- src/main/deploy/robots.json | 5 +++-- src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ 15 files changed, 45 insertions(+), 64 deletions(-) delete mode 100644 src/main/deploy/alpha/drive_modules/backleft.json delete mode 100644 src/main/deploy/alpha/drive_modules/backright.json delete mode 100644 src/main/deploy/alpha/drive_modules/frontleft.json delete mode 100644 src/main/deploy/alpha/drive_modules/frontright.json diff --git a/src/main/deploy/alpha/drive_modules/backleft.json b/src/main/deploy/alpha/drive_modules/backleft.json deleted file mode 100644 index c62ce932..00000000 --- a/src/main/deploy/alpha/drive_modules/backleft.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "s": 0.19542, - "v": 2.2924, - "a": 0.35934 -} diff --git a/src/main/deploy/alpha/drive_modules/backright.json b/src/main/deploy/alpha/drive_modules/backright.json deleted file mode 100644 index aee7fd95..00000000 --- a/src/main/deploy/alpha/drive_modules/backright.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "s": 0.18096, - "v": 2.2915, - "a": 0.37156 -} diff --git a/src/main/deploy/alpha/drive_modules/frontleft.json b/src/main/deploy/alpha/drive_modules/frontleft.json deleted file mode 100644 index bdf7d3fa..00000000 --- a/src/main/deploy/alpha/drive_modules/frontleft.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "s": 0.21848, - "v": 2.3118, - "a": 0.20314 -} diff --git a/src/main/deploy/alpha/drive_modules/frontright.json b/src/main/deploy/alpha/drive_modules/frontright.json deleted file mode 100644 index 36a1c209..00000000 --- a/src/main/deploy/alpha/drive_modules/frontright.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "s": 0.18434, - "v": 2.3018, - "a": 0.30992 -} diff --git a/src/main/deploy/alpha/robot.json b/src/main/deploy/alpha/robot.json index ddde0045..acf76fd2 100644 --- a/src/main/deploy/alpha/robot.json +++ b/src/main/deploy/alpha/robot.json @@ -1,9 +1,9 @@ { "userConfig": "competition_mode.json", "driveType": "YAGSL_SWERVE_DRIVE", - "trackWidth": 16.8, + "trackWidth": 22, "trackWidthUom": "in", - "wheelBase": 18.5, + "wheelBase": 22, "wheelBaseUom": "in", "wheelDiameter": 0.103386904, "wheelDiameterUom": "m", diff --git a/src/main/deploy/alpha/yagsl_drivetrain.json b/src/main/deploy/alpha/yagsl_drivetrain.json index c6beb5d7..9f5b045b 100644 --- a/src/main/deploy/alpha/yagsl_drivetrain.json +++ b/src/main/deploy/alpha/yagsl_drivetrain.json @@ -1,5 +1,5 @@ { - "directory": "basic_robot/yagsl_swerve", + "directory": "alpha/yagsl_swerve", "turningMotorGearRatio": 1.0, "driveModules": [ "frontleft.json", diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json b/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json index 2ac2a1ab..de7652f6 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/backleft.json @@ -1,12 +1,12 @@ { "drive": { - "type": "neo", - "id": 17, + "type": "krakenx60foc", + "id": 3, "canbus": null }, "angle": { "type": "neo", - "id": 6, + "id": 8, "canbus": null }, "encoder": { @@ -16,11 +16,11 @@ }, "inverted": { "drive": true, - "angle": true + "angle": false }, "absoluteEncoderInverted": true, "location": { - "front": -8.37, - "left": 10.88 + "front": -11, + "left": 11 } } diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/backright.json b/src/main/deploy/alpha/yagsl_swerve/modules/backright.json index eea317b8..3dd4ff88 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/backright.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/backright.json @@ -1,7 +1,7 @@ { "drive": { - "type": "neo", - "id": 18, + "type": "krakenx60foc", + "id": 5, "canbus": null }, "angle": { @@ -16,11 +16,11 @@ }, "inverted": { "drive": true, - "angle": true + "angle": false }, "absoluteEncoderInverted": true, "location": { - "front": -8.37, - "left": -10.88 + "front": -11, + "left": -11 } } diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json b/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json index 1c03c3f1..e9819980 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/frontleft.json @@ -1,7 +1,7 @@ { "drive": { - "type": "neo", - "id": 15, + "type": "krakenx60foc", + "id": 1, "canbus": null }, "angle": { @@ -16,11 +16,11 @@ }, "inverted": { "drive": true, - "angle": true + "angle": false }, "absoluteEncoderInverted": true, "location": { - "front": 8.37, - "left": 10.88 + "front": 11, + "left": 11 } } diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json b/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json index 6218565f..7a96cba3 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/frontright.json @@ -1,12 +1,12 @@ { "drive": { - "type": "neo", - "id": 16, + "type": "krakenx60foc", + "id": 7, "canbus": null }, "angle": { "type": "neo", - "id": 3, + "id": 6, "canbus": null }, "encoder": { @@ -16,11 +16,11 @@ }, "inverted": { "drive": true, - "angle": true + "angle": false }, "absoluteEncoderInverted": true, "location": { - "front": 8.37, - "left": -10.88 + "front": 11, + "left": -11 } } diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json b/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json index c921b000..12f355fc 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/physicalproperties.json @@ -1,11 +1,11 @@ { "conversionFactors": { "angle": { - "gearRatio": 12.8, + "gearRatio": 25, "factor": 0 }, "drive": { - "gearRatio": 8.14, + "gearRatio": 6.75, "diameter": 4, "factor": 0 } @@ -20,5 +20,5 @@ }, "wheelGripCoefficientOfFriction": 1.19, "optimalVoltage": 12, - "robotMass": 75 + "robotMass": 30 } diff --git a/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json b/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json index 5924fdbb..a277e703 100644 --- a/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json +++ b/src/main/deploy/alpha/yagsl_swerve/modules/pidfproperties.json @@ -1,16 +1,16 @@ { "drive": { - "p": 0.00023, - "i": 0.0000002, - "d": 1, + "p": 0.007387, + "i": 0, + "d": 0, "f": 0, "iz": 0 }, "angle": { - "p": 0.0020645, - "i": 0, + "p": 0.0049671, + "i": 0.00000, "d": 0, - "f": 0.001, - "iz": 0 + "f": 0, + "iz": 5 } } diff --git a/src/main/deploy/alpha/yagsl_swerve/swervedrive.json b/src/main/deploy/alpha/yagsl_swerve/swervedrive.json index f4876233..0a2ab21f 100644 --- a/src/main/deploy/alpha/yagsl_swerve/swervedrive.json +++ b/src/main/deploy/alpha/yagsl_swerve/swervedrive.json @@ -1,7 +1,7 @@ { "imu": { "type": "pigeon2", - "id": 13, + "id": 50, "canbus": "" }, "invertedIMU": false, diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index 011f9cb9..4f6d428f 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -10,11 +10,12 @@ "id": "00:80:2F:38:90:61", "robotClass": "frc.robot.tigershark.TigerShark", "simulate": true, - "competition": true + "competition": false }, "alpha": { - "id": "alpha", + "id": "00:80:2F:33:17:DD", "robotClass": "frc.robot.alpha.Alpha", + "competition": true, "simulate": false }, "baby_swerve": { diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index df9477d2..0d42719c 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 71; - public static final String GIT_SHA = "29dabbcd95f177097ec91cc371950f5e9efdb899"; - public static final String GIT_DATE = "2026-01-12 17:30:35 EST"; - public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-12 18:54:29 EST"; - public static final long BUILD_UNIX_TIME = 1768262069859L; + public static final int GIT_REVISION = 106; + public static final String GIT_SHA = "889c97ff2f4c50a0627b1d3952067bf59f5dbf18"; + public static final String GIT_DATE = "2026-01-16 12:38:01 EST"; + public static final String GIT_BRANCH = "prototype"; + public static final String BUILD_DATE = "2026-01-19 17:59:32 EST"; + public static final long BUILD_UNIX_TIME = 1768863572162L; public static final int DIRTY = 1; private BuildConstants() {} From fec5458375c7ca5c19e0ad0b71309ad0b0d3c8be Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Mon, 19 Jan 2026 19:03:08 -0500 Subject: [PATCH 025/371] Switch odometry thread to TalonFX and update configs Replaced usage of PhoenixOdometryThread with TalonFXOdometryThread in swerve drive modules and gyro classes for improved compatibility. Updated drivetrain JSON configuration with new CAN bus and PID/FF values. Updated build constants to reflect latest build and branch information. --- .../deploy/tigershark/akit_swerve_drivetrain.json | 14 +++++++------- src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ .../common/drive/swerve/akit/GyroIOPigeon2.java | 4 ++-- .../drive/swerve/akit/ModuleIOSparkTalon.java | 2 +- .../drive/swerve/akit/ModuleIOTalonFXReal.java | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/deploy/tigershark/akit_swerve_drivetrain.json b/src/main/deploy/tigershark/akit_swerve_drivetrain.json index 4f295f3a..20c05ad1 100644 --- a/src/main/deploy/tigershark/akit_swerve_drivetrain.json +++ b/src/main/deploy/tigershark/akit_swerve_drivetrain.json @@ -29,19 +29,19 @@ "type": "pigeon2", "id": 50, "inverted": false, - "canbus": "" + "canbus": "canivore" }, "driveGearRatio": "1:6.75", "steerGearRatio": "1:25", "driveMotorControl": { "feedBack": { - "p": 0.1, + "p": 0.00001, "i": 0.0, "d": 0.0 }, "feedForward": { - "s": 0.2, - "v": 0.124, + "s": 0.0698163127444402, + "v": 0.11987949085405275, "a": 0.0 } }, @@ -52,8 +52,8 @@ "d": 0.5 }, "feedForward": { - "s": 0.1, - "v": 1.91, + "s": 0.06242725612073021, + "v": 0.4513057312290134, "a": 0.0 } }, @@ -159,6 +159,6 @@ "val": 120, "uom": "amps" }, - "canbus": "" + "canbus": "canivore" } } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index df9477d2..170502c3 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 71; - public static final String GIT_SHA = "29dabbcd95f177097ec91cc371950f5e9efdb899"; - public static final String GIT_DATE = "2026-01-12 17:30:35 EST"; - public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-12 18:54:29 EST"; - public static final long BUILD_UNIX_TIME = 1768262069859L; + public static final int GIT_REVISION = 106; + public static final String GIT_SHA = "889c97ff2f4c50a0627b1d3952067bf59f5dbf18"; + public static final String GIT_DATE = "2026-01-16 12:38:01 EST"; + public static final String GIT_BRANCH = "prototype"; + public static final String BUILD_DATE = "2026-01-19 18:55:33 EST"; + public static final long BUILD_UNIX_TIME = 1768866933831L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java b/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java index 72064e47..64f83255 100644 --- a/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java +++ b/src/main/java/org/frc5010/common/drive/swerve/akit/GyroIOPigeon2.java @@ -36,10 +36,10 @@ public GyroIOPigeon2(AkitSwerveConfig config) { yaw.setUpdateFrequency(config.ODOMETRY_FREQUENCY); yawVelocity.setUpdateFrequency(50.0); pigeon.optimizeBusUtilization(); - yawTimestampQueue = PhoenixOdometryThread.getInstance().makeTimestampQueue(); + yawTimestampQueue = TalonFXOdometryThread.getInstance().makeTimestampQueue(); var yawClone = yaw.clone(); // Status signals are not thread-safe yawPositionQueue = - PhoenixOdometryThread.getInstance() + TalonFXOdometryThread.getInstance() .registerSignal(() -> yawClone.refresh().getValueAsDouble()); } diff --git a/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOSparkTalon.java b/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOSparkTalon.java index 09d56328..32f914ea 100644 --- a/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOSparkTalon.java +++ b/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOSparkTalon.java @@ -163,7 +163,7 @@ public ModuleIOSparkTalon( // Create drive status signals drivePosition = driveTalon.getPosition(); - drivePositionQueue = PhoenixOdometryThread.getInstance().registerSignal(drivePosition.clone()); + drivePositionQueue = TalonFXOdometryThread.getInstance().registerSignal(drivePosition.clone()); driveVelocity = driveTalon.getVelocity(); driveAppliedVolts = driveTalon.getMotorVoltage(); driveCurrent = driveTalon.getStatorCurrent(); diff --git a/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOTalonFXReal.java b/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOTalonFXReal.java index 33ceb56f..278d410f 100644 --- a/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOTalonFXReal.java +++ b/src/main/java/org/frc5010/common/drive/swerve/akit/ModuleIOTalonFXReal.java @@ -34,11 +34,11 @@ public class ModuleIOTalonFXReal extends ModuleIOTalonFX { public ModuleIOTalonFXReal(AkitSwerveConfig config, SwerveModuleConstants constants) { super(config, constants); - this.timestampQueue = PhoenixOdometryThread.getInstance().makeTimestampQueue(); + this.timestampQueue = TalonFXOdometryThread.getInstance().makeTimestampQueue(); this.drivePositionQueue = - PhoenixOdometryThread.getInstance().registerSignal(super.drivePosition); + TalonFXOdometryThread.getInstance().registerSignal(super.drivePosition); this.turnPositionQueue = - PhoenixOdometryThread.getInstance().registerSignal(super.turnAbsolutePosition); + TalonFXOdometryThread.getInstance().registerSignal(super.turnAbsolutePosition); } @Override From 6a1a88f0f67658f6280666e4e9a09ebdb6eb8497 Mon Sep 17 00:00:00 2001 From: Curt Date: Mon, 19 Jan 2026 20:08:10 -0500 Subject: [PATCH 026/371] Update competition flags in robots.json Swapped the 'competition' flags for TigerShark and Alpha robots: TigerShark is now set for competition, while Alpha is not. This ensures correct deployment configuration for each robot. --- src/main/deploy/robots.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/deploy/robots.json b/src/main/deploy/robots.json index 4f6d428f..7b650cf1 100644 --- a/src/main/deploy/robots.json +++ b/src/main/deploy/robots.json @@ -10,12 +10,12 @@ "id": "00:80:2F:38:90:61", "robotClass": "frc.robot.tigershark.TigerShark", "simulate": true, - "competition": false + "competition": true }, "alpha": { "id": "00:80:2F:33:17:DD", "robotClass": "frc.robot.alpha.Alpha", - "competition": true, + "competition": false, "simulate": false }, "baby_swerve": { From a191b5c49a388b37254b7577912c00bf8837f693 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 16:31:35 -0500 Subject: [PATCH 027/371] Created Commands Directory Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/commands/AutoCommands.java | 0 src/main/java/frc/robot/rebuilt/commands/TestCommands.java | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/AutoCommands.java create mode 100644 src/main/java/frc/robot/rebuilt/commands/TestCommands.java diff --git a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java new file mode 100644 index 00000000..e69de29b diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java new file mode 100644 index 00000000..e69de29b From 43770e0893ecd9cf0a8d90e55d6cd91b1adceb1c Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 16:36:27 -0500 Subject: [PATCH 028/371] Made indexer and intake in IntakeCommands IntakeCommands holds references to an Indexer and an Intake subsystem. It also stores a Map called intakeMap, likely used to manage subsystems by name. The constructor accepts the subsystem map, saves it, and creates new instances of Indexer and Intake. --- src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java new file mode 100644 index 00000000..e69de29b From 1974f1b8550e611a5c2dd0ea93105635bc5e4d28 Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 21 Jan 2026 17:12:02 -0500 Subject: [PATCH 029/371] autos --- .../deploy/pathplanner/autos/New Auto.auto | 8 +- .../pathplanner/autos/New outpost climb.auto | 49 +++++++ .../autos/lose collecting n climb.auto | 18 +++ .../pathplanner/autos/win shoot climb.auto | 12 ++ .../pathplanner/paths/editititited.path | 54 ++++++++ .../paths/lose collecting climb.path | 50 +++---- .../pathplanner/paths/lose collecting.path | 71 ++++++---- .../pathplanner/paths/win shoot n climb.path | 131 ------------------ .../robot/rebuilt/autos/ANamedCommands.java | 12 ++ 9 files changed, 221 insertions(+), 184 deletions(-) create mode 100644 src/main/deploy/pathplanner/autos/New outpost climb.auto create mode 100644 src/main/deploy/pathplanner/paths/editititited.path delete mode 100644 src/main/deploy/pathplanner/paths/win shoot n climb.path create mode 100644 src/main/java/frc/robot/rebuilt/autos/ANamedCommands.java diff --git a/src/main/deploy/pathplanner/autos/New Auto.auto b/src/main/deploy/pathplanner/autos/New Auto.auto index 7c89d751..5434e7f8 100644 --- a/src/main/deploy/pathplanner/autos/New Auto.auto +++ b/src/main/deploy/pathplanner/autos/New Auto.auto @@ -7,7 +7,13 @@ { "type": "path", "data": { - "pathName": "win shoot n climb" + "pathName": "lose collecting" + } + }, + { + "type": "path", + "data": { + "pathName": "edititititited p2" } } ] diff --git a/src/main/deploy/pathplanner/autos/New outpost climb.auto b/src/main/deploy/pathplanner/autos/New outpost climb.auto new file mode 100644 index 00000000..9e65de92 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/New outpost climb.auto @@ -0,0 +1,49 @@ +{ + "version": "2025.0", + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "shoot 8" + } + }, + { + "type": "path", + "data": { + "pathName": "editititited" + } + }, + { + "type": "wait", + "data": { + "waitTime": 2.0 + } + }, + { + "type": "path", + "data": { + "pathName": "edititititited p2" + } + }, + { + "type": "named", + "data": { + "name": "shoot " + } + }, + { + "type": "named", + "data": { + "name": "climb" + } + } + ] + } + }, + "resetOdom": true, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/lose collecting n climb.auto b/src/main/deploy/pathplanner/autos/lose collecting n climb.auto index 391ecaea..af1c4afd 100644 --- a/src/main/deploy/pathplanner/autos/lose collecting n climb.auto +++ b/src/main/deploy/pathplanner/autos/lose collecting n climb.auto @@ -4,6 +4,12 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "shoot 8" + } + }, { "type": "path", "data": { @@ -15,6 +21,18 @@ "data": { "pathName": "lose collecting climb" } + }, + { + "type": "named", + "data": { + "name": "shoot " + } + }, + { + "type": "named", + "data": { + "name": "climb" + } } ] } diff --git a/src/main/deploy/pathplanner/autos/win shoot climb.auto b/src/main/deploy/pathplanner/autos/win shoot climb.auto index 7c89d751..2aa5c825 100644 --- a/src/main/deploy/pathplanner/autos/win shoot climb.auto +++ b/src/main/deploy/pathplanner/autos/win shoot climb.auto @@ -4,11 +4,23 @@ "type": "sequential", "data": { "commands": [ + { + "type": "named", + "data": { + "name": "shoot 8" + } + }, { "type": "path", "data": { "pathName": "win shoot n climb" } + }, + { + "type": "wait", + "data": { + "waitTime": 3.0 + } } ] } diff --git a/src/main/deploy/pathplanner/paths/editititited.path b/src/main/deploy/pathplanner/paths/editititited.path new file mode 100644 index 00000000..9d9c5fce --- /dev/null +++ b/src/main/deploy/pathplanner/paths/editititited.path @@ -0,0 +1,54 @@ +{ + "version": "2025.0", + "waypoints": [ + { + "anchor": { + "x": 3.6167890995260663, + "y": 0.6821090047393341 + }, + "prevControl": null, + "nextControl": { + "x": 3.36687142125592, + "y": 0.6756938595297841 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 0.40246212121212177, + "y": 0.6821090047393341 + }, + "prevControl": { + "x": 0.6524466173311325, + "y": 0.6793248172233193 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "pointTowardsZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 5.25, + "maxAcceleration": 10.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0, + "nominalVoltage": 12.0, + "unlimited": false + }, + "goalEndState": { + "velocity": 0, + "rotation": -1.3734299495056042 + }, + "reversed": false, + "folder": null, + "idealStartingState": { + "velocity": 0.0, + "rotation": -0.7745039229267884 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/lose collecting climb.path b/src/main/deploy/pathplanner/paths/lose collecting climb.path index f2dad83a..31711b54 100644 --- a/src/main/deploy/pathplanner/paths/lose collecting climb.path +++ b/src/main/deploy/pathplanner/paths/lose collecting climb.path @@ -3,57 +3,57 @@ "waypoints": [ { "anchor": { - "x": 7.786409952601321, - "y": 1.1764454976293326 + "x": 7.799873577749684, + "y": 5.0727180783817944 }, "prevControl": null, "nextControl": { - "x": 8.075589980201004, - "y": 1.0300009891827078 + "x": 8.016874855868656, + "y": 4.948579263763913 }, - "isLocked": true, + "isLocked": false, "linkedName": "lose collecting end" }, { "anchor": { - "x": 5.454431279620853, - "y": 2.433779620853079 + "x": 5.426308470290771, + "y": 5.519911504424779 }, "prevControl": { - "x": 6.198068133177621, - "y": 2.340066018770411 + "x": 5.728548876062032, + "y": 5.411741253938223 }, "nextControl": { - "x": 3.647707566207364, - "y": 2.661464123500213 + "x": 4.336991150442478, + "y": 5.909772439949432 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 2.9720023696682465, - "y": 2.6164691943127956 + "x": 2.8692793931731995, + "y": 4.808988621997471 }, "prevControl": { - "x": 3.1452525660392245, - "y": 2.433671737004806 + "x": 4.127458594731252, + "y": 5.066687976533457 }, "nextControl": { - "x": 1.9376429900514227, - "y": 3.7078287915726733 + "x": 1.9175600505689014, + "y": 4.614058154235145 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 1.4674999999999998, - "y": 3.701860189573459 + "x": 1.4359671302149184, + "y": 3.364209860935524 }, "prevControl": { - "x": 1.6461059512272682, - "y": 3.4642957352770187 + "x": 1.9503179748458601, + "y": 3.448304745612054 }, "nextControl": null, "isLocked": false, @@ -61,10 +61,6 @@ } ], "rotationTargets": [ - { - "waypointRelativePos": 0.9135638297872317, - "rotationDegrees": -91.50962891206528 - }, { "waypointRelativePos": 1.743351063829786, "rotationDegrees": -90.71356928173023 @@ -83,13 +79,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": 91.54815769897797 + "rotation": 0.0 }, "reversed": false, "folder": null, "idealStartingState": { "velocity": 1.0, - "rotation": -91.25904520717523 + "rotation": -91.5797555540147 }, "useDefaultConstraints": true } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/lose collecting.path b/src/main/deploy/pathplanner/paths/lose collecting.path index 9ac79df1..d76be7a4 100644 --- a/src/main/deploy/pathplanner/paths/lose collecting.path +++ b/src/main/deploy/pathplanner/paths/lose collecting.path @@ -3,29 +3,29 @@ "waypoints": [ { "anchor": { - "x": 3.6060426540284354, - "y": 5.560995260663506 + "x": 3.7779857819905214, + "y": 7.3556516587667735 }, "prevControl": null, "nextControl": { - "x": 6.307048313048284, - "y": 5.755880238268784 + "x": 6.5184271158445615, + "y": 7.492599578170781 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 5.77682464454445, - "y": 5.700699052131703 + "x": 5.787571090047394, + "y": 7.463116113744076 }, "prevControl": { - "x": 5.483918224952944, - "y": 5.669865584965646 + "x": 5.10403647211301, + "y": 7.4993655616958295 }, "nextControl": { - "x": 6.46177947033134, - "y": 5.772802395447242 + "x": 6.65218869338407, + "y": 7.41726340930456 }, "isLocked": false, "linkedName": null @@ -36,24 +36,24 @@ "y": 7.3556516587667735 }, "prevControl": { - "x": 6.562277390657639, - "y": 7.673208781684035 + "x": 7.245328555598695, + "y": 7.454948287619735 }, "nextControl": { - "x": 8.512747947486812, - "y": 6.9944191224230865 + "x": 8.343436599587307, + "y": 6.979699632584963 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 7.786409952601321, - "y": 1.1764454976293326 + "x": 7.799873577749684, + "y": 5.0727180783817944 }, "prevControl": { - "x": 7.532670242876316, - "y": 3.5241380714482045 + "x": 7.41001264222503, + "y": 5.542844500632111 }, "nextControl": null, "isLocked": true, @@ -61,10 +61,6 @@ } ], "rotationTargets": [ - { - "waypointRelativePos": 0.5625000000000004, - "rotationDegrees": 0.8658502632874043 - }, { "waypointRelativePos": 2.2180851063829854, "rotationDegrees": -88.5493322160677 @@ -72,7 +68,32 @@ ], "constraintZones": [], "pointTowardsZones": [], - "eventMarkers": [], + "eventMarkers": [ + { + "name": "", + "waypointRelativePos": 0, + "endWaypointRelativePos": null, + "command": null + }, + { + "name": "", + "waypointRelativePos": 0.5398579321231256, + "endWaypointRelativePos": null, + "command": null + }, + { + "name": "", + "waypointRelativePos": 2.207943925233647, + "endWaypointRelativePos": null, + "command": null + }, + { + "name": "", + "waypointRelativePos": 3.0, + "endWaypointRelativePos": null, + "command": null + } + ], "globalConstraints": { "maxVelocity": 3.0, "maxAcceleration": 3.0, @@ -83,13 +104,13 @@ }, "goalEndState": { "velocity": 1.0, - "rotation": -91.25904520717523 + "rotation": -91.5797555540147 }, "reversed": false, "folder": null, "idealStartingState": { "velocity": 0, - "rotation": 0.7161599454083509 + "rotation": -90.13695084948883 }, "useDefaultConstraints": false } \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/win shoot n climb.path b/src/main/deploy/pathplanner/paths/win shoot n climb.path deleted file mode 100644 index e940c6fc..00000000 --- a/src/main/deploy/pathplanner/paths/win shoot n climb.path +++ /dev/null @@ -1,131 +0,0 @@ -{ - "version": "2025.0", - "waypoints": [ - { - "anchor": { - "x": 3.6490284360189573, - "y": 5.851149289099526 - }, - "prevControl": null, - "nextControl": { - "x": 3.004952544805466, - "y": 7.575751220483924 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 0.3821090047393362, - "y": 7.162215639810427 - }, - "prevControl": { - "x": 0.4492871540759737, - "y": 7.795609619276372 - }, - "nextControl": { - "x": 0.3068838862568361, - "y": 6.4529502369684595 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 0.3821090047393362, - "y": 5.657713270143815 - }, - "prevControl": { - "x": 0.38210900474024867, - "y": 6.076824644551397 - }, - "nextControl": { - "x": 0.3821090047377958, - "y": 4.9502428869060235 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 1.8651184834123224, - "y": 4.9914336492891 - }, - "prevControl": { - "x": 1.5819843890770973, - "y": 5.247339973853388 - }, - "nextControl": { - "x": 2.2914344324655844, - "y": 4.606114643884585 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 2.2304976303326662, - "y": 4.013507109006374 - }, - "prevControl": { - "x": 2.1980751612820484, - "y": 4.5107750328942835 - }, - "nextControl": { - "x": 2.2616224773239844, - "y": 3.536140995385034 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 1.5104857819914335, - "y": 3.691113744077464 - }, - "prevControl": { - "x": 1.5357807988591312, - "y": 3.361116937030295 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [ - { - "waypointRelativePos": 0.9760638297872352, - "rotationDegrees": -89.91035962462058 - }, - { - "waypointRelativePos": 2.042553191489365, - "rotationDegrees": -88.41355874106515 - }, - { - "waypointRelativePos": 3.090425531914899, - "rotationDegrees": -91.40947522332182 - } - ], - "constraintZones": [], - "pointTowardsZones": [], - "eventMarkers": [], - "globalConstraints": { - "maxVelocity": 5.25, - "maxAcceleration": 10.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0, - "nominalVoltage": 12.0, - "unlimited": false - }, - "goalEndState": { - "velocity": 0, - "rotation": 90.0 - }, - "reversed": false, - "folder": null, - "idealStartingState": { - "velocity": 0, - "rotation": -179.31793960682737 - }, - "useDefaultConstraints": true -} \ No newline at end of file diff --git a/src/main/java/frc/robot/rebuilt/autos/ANamedCommands.java b/src/main/java/frc/robot/rebuilt/autos/ANamedCommands.java new file mode 100644 index 00000000..936a8fc0 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/autos/ANamedCommands.java @@ -0,0 +1,12 @@ +package frc.robot.rebuilt.autos; + +import com.pathplanner.lib.auto.NamedCommands; +import edu.wpi.first.wpilibj2.command.Commands; + +public class ANamedCommands { + public static void CreateNamedCommands() { + NamedCommands.registerCommand("shoot 8", Commands.print("Fired 8")); + NamedCommands.registerCommand("shoot", Commands.print("Fired")); + NamedCommands.registerCommand("climb", Commands.print("climbed")); + } +} From cff3f87e1ba24d8861da250a66901402bf6caba8 Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 21 Jan 2026 17:20:25 -0500 Subject: [PATCH 030/371] auto and test commands Co-Authored-By: CameronSkea <233858202+CameronSkea@users.noreply.github.com> --- .../robot/rebuilt/commands/AutoCommands.java | 21 +++++++++++++++++++ .../robot/rebuilt/commands/TestCommands.java | 13 ++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java index e69de29b..917274aa 100644 --- a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java @@ -0,0 +1,21 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +import org.frc5010.common.arch.GenericSubsystem; + +public class AutoCommands { + + private Map subsystems; + + public void AutoCommands(Map subsystems){ + this.subsystems = subsystems; +} + + + public static void configureNamedCommands(){ + + } + +} + diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index e69de29b..7c3cdf54 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -0,0 +1,13 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +import org.frc5010.common.arch.GenericSubsystem; + +public class TestCommands{ + + private Map subsystems; +public void TestCommands(Map subsystems){ + this.subsystems = subsystems; +} +} \ No newline at end of file From aaef6bbbefe80c382d5d453d6131b10b3c053f3b Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 17:20:45 -0500 Subject: [PATCH 031/371] Created new versions of the subystems in rebuilt.java Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 8 ++++---- src/main/java/frc/robot/rebuilt/subsystems/Launcher.java | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 95f0e57c..a13e5c3b 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -32,10 +32,10 @@ public class Rebuilt extends GenericRobot { public Rebuilt(String directory) { super(directory); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); - indexer = new Indexer(); - climb = new Climb(); - intake = new Intake(); - launcher = new Launcher(); + indexer = (Indexer) subsystems.get(ConfigConstants.INDEXER); + climb = (Climb) subsystems.get(ConfigConstants.CLIMB); + intake = (Intake) subsystems.get(ConfigConstants.INTAKE); + launcher = (Launcher) subsystems.get(ConfigConstants.LAUNCHER); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index 351b6c6a..5e28d5e3 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -4,9 +4,10 @@ package frc.robot.rebuilt.subsystems; -import edu.wpi.first.wpilibj2.command.SubsystemBase; +import org.frc5010.common.arch.GenericSubsystem; -public class Launcher extends SubsystemBase { + +public class Launcher extends GenericSubsystem { /** Creates a new Launcher. */ public Launcher() { super("launcher.json"); From 9d933bf481118f02a9bcb0a988fbcc02414448fe Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 17:22:45 -0500 Subject: [PATCH 032/371] StateMachine and other stuff --- src/main/java/frc/robot/BuildConstants.java | 12 ++++----- .../robot/rebuilt/commands/AutoCommands.java | 1 + .../rebuilt/commands/IntakeCommands.java | 27 +++++++++++++++++++ .../robot/rebuilt/commands/TestCommands.java | 1 + .../common/commands/LedDefaultCommand.java | 2 +- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 46c0582d..525417ae 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 74; - public static final String GIT_SHA = "2dd9e1e6bdf2bdcb20afb123981a563d39ee8bac"; - public static final String GIT_DATE = "2026-01-15 12:50:29 EST"; - public static final String GIT_BRANCH = "main"; - public static final String BUILD_DATE = "2026-01-19 21:22:51 EST"; - public static final long BUILD_UNIX_TIME = 1768875771746L; + public static final int GIT_REVISION = 130; + public static final String GIT_SHA = "43770e0893ecd9cf0a8d90e55d6cd91b1adceb1c"; + public static final String GIT_DATE = "2026-01-21 16:36:27 EST"; + public static final String GIT_BRANCH = "Rebuilt"; + public static final String BUILD_DATE = "2026-01-21 16:49:06 EST"; + public static final long BUILD_UNIX_TIME = 1769032146956L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java index e69de29b..8b137891 100644 --- a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java @@ -0,0 +1 @@ + diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index e69de29b..20958899 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -0,0 +1,27 @@ +package frc.robot.rebuilt.commands; + +import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Intake; +import java.util.Map; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; +import edu.wpi.first.wpilibj2.command.Commands; + +public class IntakeCommands { + Indexer indexer; + Intake intake; + Map intakeMap; + StateMachine intakeStateMachine = new StateMachine("IntakeStateMachine"); + public IntakeCommands(Map intakeMap) { + this.intakeMap = intakeMap; + indexer = new Indexer(); + intake = new Intake(); + } + State retracting = + intakeStateMachine.addState("retracting", + Commands.print("RETRACTING").andThen(intake.spintakeCommand(0))); + State intaking = + intakeStateMachine.addState("intaking", + Commands.print("INTAKING").andThen()); +} diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index e69de29b..8b137891 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -0,0 +1 @@ + diff --git a/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java b/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java index f9a1ec5b..05636b5e 100644 --- a/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java +++ b/src/main/java/org/frc5010/common/commands/LedDefaultCommand.java @@ -11,7 +11,7 @@ public class LedDefaultCommand extends Command { /** Creates a new LedDefaultCommand. */ LedSubsystem ledSubsystem; - //private int currDelay = 200; + // private int currDelay = 200; private boolean lastState; public LedDefaultCommand(LedSubsystem ledSubsystem) { From 8440367b5a4d1890ff4a54156f31e654271e0873 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 17:25:25 -0500 Subject: [PATCH 033/371] ConfigConstants update Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 22 +++++++++++-------- .../common/config/ConfigConstants.java | 4 ++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index a13e5c3b..eb4433d3 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,30 +4,34 @@ package frc.robot.rebuilt; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; + import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.commands.AutoCommands; +import frc.robot.rebuilt.commands.TestCommands; +import frc.robot.rebuilt.commands.IntakeCommands; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; -import org.frc5010.common.arch.GenericRobot; -import org.frc5010.common.arch.StateMachine; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.motors.function.PercentControlMotor; -import org.frc5010.common.sensors.Controller; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { SwerveConstants swerveConstants; GenericDrivetrain drivetrain; - PercentControlMotor percentControlMotor; - StateMachine stateMachine = new StateMachine("ExampleStateMachine"); Indexer indexer; Climb climb; Intake intake; Launcher launcher; + AutoCommands autocommands; + TestCommands testCommands; + IntakeCommands intakecommands; + public Rebuilt(String directory) { super(directory); diff --git a/src/main/java/org/frc5010/common/config/ConfigConstants.java b/src/main/java/org/frc5010/common/config/ConfigConstants.java index cc622b0b..68e8c9c2 100644 --- a/src/main/java/org/frc5010/common/config/ConfigConstants.java +++ b/src/main/java/org/frc5010/common/config/ConfigConstants.java @@ -4,6 +4,10 @@ public class ConfigConstants { public static final String GYRO = "gyro"; public static final String DRIVETRAIN = "drivetrain"; + public static final String INDEXER = "indexer"; + public static final String CLIMB = "climb"; + public static final String INTAKE = "intake"; + public static final String LAUNCHER = "launcher"; public static final String ALL_LEDS = "all_leds"; } From 1938fca3f6fdf52f819d0b05bfaf77dae8e4fecb Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Wed, 21 Jan 2026 17:35:44 -0500 Subject: [PATCH 034/371] test commands Co-Authored-By: CameronSkea <233858202+CameronSkea@users.noreply.github.com> --- src/main/java/frc/robot/BuildConstants.java | 10 +++--- src/main/java/frc/robot/rebuilt/Rebuilt.java | 14 ++++---- .../robot/rebuilt/commands/AutoCommands.java | 16 +++------- .../rebuilt/commands/IntakeCommands.java | 14 ++++---- .../robot/rebuilt/commands/TestCommands.java | 32 ++++++++++++++++--- .../robot/rebuilt/subsystems/Launcher.java | 1 - 6 files changed, 50 insertions(+), 37 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 525417ae..55d7ed1a 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 130; - public static final String GIT_SHA = "43770e0893ecd9cf0a8d90e55d6cd91b1adceb1c"; - public static final String GIT_DATE = "2026-01-21 16:36:27 EST"; + public static final int GIT_REVISION = 137; + public static final String GIT_SHA = "8440367b5a4d1890ff4a54156f31e654271e0873"; + public static final String GIT_DATE = "2026-01-21 17:25:25 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-21 16:49:06 EST"; - public static final long BUILD_UNIX_TIME = 1769032146956L; + public static final String BUILD_DATE = "2026-01-21 17:33:34 EST"; + public static final long BUILD_UNIX_TIME = 1769034814866L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index eb4433d3..8db2b0d0 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,21 +4,20 @@ package frc.robot.rebuilt; -import org.frc5010.common.arch.GenericRobot; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.sensors.Controller; - import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; -import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.commands.IntakeCommands; +import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { @@ -31,7 +30,6 @@ public class Rebuilt extends GenericRobot { AutoCommands autocommands; TestCommands testCommands; IntakeCommands intakecommands; - public Rebuilt(String directory) { super(directory); diff --git a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java index 917274aa..a7e95802 100644 --- a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java @@ -1,21 +1,15 @@ package frc.robot.rebuilt.commands; import java.util.Map; - import org.frc5010.common.arch.GenericSubsystem; public class AutoCommands { - private Map subsystems; - - public void AutoCommands(Map subsystems){ - this.subsystems = subsystems; -} - - - public static void configureNamedCommands(){ + private Map subsystems; - } + public void AutoCommands(Map subsystems) { + this.subsystems = subsystems; + } + public static void configureNamedCommands() {} } - diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index 20958899..0ee4cccd 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -1,27 +1,27 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; -import edu.wpi.first.wpilibj2.command.Commands; public class IntakeCommands { Indexer indexer; Intake intake; Map intakeMap; StateMachine intakeStateMachine = new StateMachine("IntakeStateMachine"); + public IntakeCommands(Map intakeMap) { this.intakeMap = intakeMap; indexer = new Indexer(); intake = new Intake(); } - State retracting = - intakeStateMachine.addState("retracting", - Commands.print("RETRACTING").andThen(intake.spintakeCommand(0))); - State intaking = - intakeStateMachine.addState("intaking", - Commands.print("INTAKING").andThen()); + + State retracting = + intakeStateMachine.addState( + "retracting", Commands.print("RETRACTING").andThen(intake.spintakeCommand(0))); + State intaking = intakeStateMachine.addState("intaking", Commands.print("INTAKING").andThen()); } diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 7c3cdf54..d793a3d0 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -1,13 +1,35 @@ package frc.robot.rebuilt.commands; +import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Intake; +import frc.robot.rebuilt.subsystems.Launcher; import java.util.Map; - import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.sensors.Controller; + +public class TestCommands { + + private Map subsystems; -public class TestCommands{ + Indexer indexer; + Climb climb; + Intake intake; + Launcher launcher; - private Map subsystems; -public void TestCommands(Map subsystems){ + public void TestCommands(Map subsystems) { this.subsystems = subsystems; + indexer = (Indexer) subsystems.get(ConfigConstants.INDEXER); + climb = (Climb) subsystems.get(ConfigConstants.CLIMB); + intake = (Intake) subsystems.get(ConfigConstants.INTAKE); + launcher = (Launcher) subsystems.get(ConfigConstants.LAUNCHER); + } + + public void configureButtonBindings(Controller controller) { + + indexer.ConfigController(controller); + intake.ConfigController(controller); + climb.ConfigController(controller); + } } -} \ No newline at end of file diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index 5e28d5e3..2b609dd8 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -6,7 +6,6 @@ import org.frc5010.common.arch.GenericSubsystem; - public class Launcher extends GenericSubsystem { /** Creates a new Launcher. */ public Launcher() { From f60c32230c60245c1b25f558bea1f6ce17f894d5 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 17:36:21 -0500 Subject: [PATCH 035/371] Created ClimbCommands and also added configureButtonBindings Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 7 ++++-- .../robot/rebuilt/commands/ClimbCommands.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index eb4433d3..fd5e6d08 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -13,8 +13,9 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; -import frc.robot.rebuilt.commands.TestCommands; +import frc.robot.rebuilt.commands.ClimbCommands; import frc.robot.rebuilt.commands.IntakeCommands; +import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; @@ -29,8 +30,10 @@ public class Rebuilt extends GenericRobot { Intake intake; Launcher launcher; AutoCommands autocommands; - TestCommands testCommands; + ClimbCommands climbCommands; IntakeCommands intakecommands; + TestCommands testCommands; + public Rebuilt(String directory) { diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java new file mode 100644 index 00000000..790592c1 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -0,0 +1,22 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; + +public class ClimbCommands { + + private Map subsystems; + + public void ClimbCommands(Map subsystems){ + this.subsystems = subsystems; +} + + + public void configureButtonBindings(Controller controller){ + + } + +} + From b443f2545c2494425356993a32271ce833fbe6db Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 17:51:15 -0500 Subject: [PATCH 036/371] call testCommands.configureButtonBindings in Rebuilt Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index aa66f583..c0b73e22 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,21 +4,13 @@ package frc.robot.rebuilt; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.AutoCommands; -import frc.robot.rebuilt.commands.IntakeCommands; -import frc.robot.rebuilt.commands.TestCommands; -import frc.robot.rebuilt.subsystems.Climb; -import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; -import frc.robot.rebuilt.subsystems.Launcher; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.constants.SwerveConstants; import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.sensors.Controller; +import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; @@ -59,6 +51,14 @@ public void configureButtonBindings(Controller driver, Controller operator) { indexer.ConfigController(driver); intake.ConfigController(driver); climb.ConfigController(driver); + + if (DriverStation.isTest ()){ + testCommands.configureButtonBindings(driver); + } + else{ + // Add teleop commands here + } + } @Override From 081c80cf75699c4c5bbba0834fc00694d54c31fd Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Wed, 21 Jan 2026 17:55:53 -0500 Subject: [PATCH 037/371] Refactor launcher subsystem for dual shooter motors Split shooter configuration into upper and lower motors with new JSON files and updated device names. Updated Launcher subsystem to support separate control for upper and lower shooter motors, hood, and turret. Added new test command for launcher and improved controller configuration. Also added logging for unknown device keys in DeviceConfigReader. --- .../rebuilt_robot/subsystems/launcher.json | 8 +- .../subsystems/launcher/hood.json | 2 +- .../{shooter.json => shooter_lower.json} | 6 +- .../subsystems/launcher/shooter_upper.json | 48 ++++++ .../subsystems/launcher/turret.json | 4 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 4 + .../robot/rebuilt/subsystems/Launcher.java | 157 ++++++++++++++++++ .../json/devices/DeviceConfigReader.java | 1 + 8 files changed, 222 insertions(+), 8 deletions(-) rename src/main/deploy/rebuilt_robot/subsystems/launcher/{shooter.json => shooter_lower.json} (86%) create mode 100644 src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json index 17da4732..4e1d5fc7 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher.json @@ -6,10 +6,14 @@ }, { "device": "yams_shooter", - "file": "launcher/shooter.json" + "file": "launcher/shooter_upper.json" }, { - "device": "yams_pivot", + "device": "yams_shooter", + "file": "launcher/shooter_lower.json" + }, + { + "device": "yams_turret", "file": "launcher/turret.json" } ], diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index 899445d1..f936b512 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -1,6 +1,6 @@ { "motorSetup": { - "name": "hood_motor", + "name": "hoodmotor", "controllerType": "talonfx", "motorType": "KrakenX60", "canId": 13 diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json similarity index 86% rename from src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json index 0be37a6e..0b7ce46b 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json @@ -1,8 +1,8 @@ { "motorSetup": { - "name": "shooter_motor", - "controllerType": "spark", - "motorType": "Neo", + "name": "lowershootermotor", + "controllerType": "talonfx", + "motorType": "KrakenX60", "canId": 14 }, "motorSystemId": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json new file mode 100644 index 00000000..1d752ed7 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json @@ -0,0 +1,48 @@ +{ + "motorSetup": { + "name": "uppershootermotor", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 15 + }, + "motorSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "lowerSoftLimit": { + "val": 0, + "uom": "rpm" + }, + "upperSoftLimit": { + "val": 5000, + "uom": "rpm" + }, + "gearing": [ + 3, + 4 + ], + "mass": { + "val": 2, + "uom": "kg" + }, + "diameter": { + "val": 0.05, + "uom": "m" + } +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index 2629504a..f3750772 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "turret_motor", + "name": "turretmotor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 15 + "canId": 16 }, "motorSystemId": { "feedBack": { diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index c0b73e22..39bbb557 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -50,6 +50,7 @@ public Rebuilt(String directory) { public void configureButtonBindings(Controller driver, Controller operator) { indexer.ConfigController(driver); intake.ConfigController(driver); +<<<<<<< Updated upstream climb.ConfigController(driver); if (DriverStation.isTest ()){ @@ -59,6 +60,9 @@ public void configureButtonBindings(Controller driver, Controller operator) { // Add teleop commands here } +======= + launcher.ConfigController(driver); +>>>>>>> Stashed changes } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index 2b609dd8..e715a1b1 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -4,16 +4,173 @@ package frc.robot.rebuilt.subsystems; +<<<<<<< Updated upstream import org.frc5010.common.arch.GenericSubsystem; public class Launcher extends GenericSubsystem { +======= +import java.util.Map; +import edu.wpi.first.units.Units; +import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; +import yams.mechanisms.positional.Arm; +import yams.mechanisms.positional.Pivot; +import yams.mechanisms.velocity.FlyWheel; + +public class Launcher extends GenericSubsystem { + private Pivot Turret; + private Arm Hood; + private FlyWheel UpperShooter; + private FlyWheel LowerShooter; + +>>>>>>> Stashed changes /** Creates a new Launcher. */ + public Launcher() { super("launcher.json"); + Turret = (Pivot) devices.get("turretmotor"); + Hood = (Arm) devices.get("hoodmotor"); + UpperShooter = (FlyWheel) devices.get("uppershootermotor"); + LowerShooter = (FlyWheel) devices.get("lowershootermotor"); + + } + + public void runShooter(double speed) { + UpperShooter.getMotor().setDutyCycle(speed); + LowerShooter.getMotor().setDutyCycle(speed); + } + + public void setUpperSpeed(double speed) { + UpperShooter.getMotor().setDutyCycle(speed); + } + + public void setLowerSpeed(double speed) { + LowerShooter.getMotor().setDutyCycle(speed); + } + + public void setHoodAngle(Angle angle) { + Hood.getMotorController().setPosition(angle); + } + + public void setTurretRotation(Angle angle) { + Turret.getMotorController().setPosition(angle); + } + + public Command testLauncherCommand(double speed, double time) { + + return (Commands.run( + () -> { + runShooter(speed); + }) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + runShooter(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setUpperSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setUpperSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setLowerSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setLowerSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setHoodAngle(Units.Degrees.of(90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setHoodAngle(Units.Degrees.of(180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setHoodAngle(Units.Degrees.of(-90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setHoodAngle(Units.Degrees.of(-180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setHoodAngle(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setTurretRotation(Units.Degrees.of(90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setTurretRotation(Units.Degrees.of(-90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + setTurretRotation(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .repeatedly(); + } + + public void ConfigController(Controller controller) { + controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); } @Override public void periodic() { // This method will be called once per scheduler run + super.periodic(); + } + + @Override + public void simulationPeriodic() { + super.simulationPeriodic(); } } diff --git a/src/main/java/org/frc5010/common/config/json/devices/DeviceConfigReader.java b/src/main/java/org/frc5010/common/config/json/devices/DeviceConfigReader.java index d922da33..29e92ad6 100644 --- a/src/main/java/org/frc5010/common/config/json/devices/DeviceConfigReader.java +++ b/src/main/java/org/frc5010/common/config/json/devices/DeviceConfigReader.java @@ -102,6 +102,7 @@ public static void readDeviceConfig(GenericSubsystem system, File deviceFile, St yamsShooterConfigurationJson.configure(system)); break; default: + System.out.println("Unknown device key: " + key); break; } } From 3604c9058ad025ae9980ad982f6b709050aed4c7 Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Wed, 21 Jan 2026 17:59:06 -0500 Subject: [PATCH 038/371] Add IndexerCommands file Created a new IndexerCommands file in the rebuilt commands package. The file is currently empty and serves as a placeholder for future command implementations. --- src/main/java/frc/robot/rebuilt/commands/IndexerCommands | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerCommands diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands new file mode 100644 index 00000000..e69de29b From 950016486f8cb77e74eef17bec5cf18303b34e41 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 18:36:40 -0500 Subject: [PATCH 039/371] Instantiate the subsystems Co-Authored-By: Curt <15949244+clrozeboom@users.noreply.github.com> --- src/main/java/frc/robot/BuildConstants.java | 12 ++-- src/main/java/frc/robot/rebuilt/Rebuilt.java | 31 ++++------ .../robot/rebuilt/commands/ClimbCommands.java | 62 +++++++++++++++---- .../robot/rebuilt/subsystems/Launcher.java | 11 +--- 4 files changed, 69 insertions(+), 47 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 55d7ed1a..3bdbefab 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "rebuilt2026"; + public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 137; - public static final String GIT_SHA = "8440367b5a4d1890ff4a54156f31e654271e0873"; - public static final String GIT_DATE = "2026-01-21 17:25:25 EST"; + public static final int GIT_REVISION = 144; + public static final String GIT_SHA = "ff17e204f8f65c364995b112e94af09d94fc1bab"; + public static final String GIT_DATE = "2026-01-21 17:59:29 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-21 17:33:34 EST"; - public static final long BUILD_UNIX_TIME = 1769034814866L; + public static final String BUILD_DATE = "2026-01-21 18:33:04 EST"; + public static final long BUILD_UNIX_TIME = 1769038384705L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 39bbb557..49bf31cb 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,12 +4,6 @@ package frc.robot.rebuilt; -import org.frc5010.common.arch.GenericRobot; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.sensors.Controller; - import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; @@ -21,6 +15,11 @@ import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { @@ -34,35 +33,27 @@ public class Rebuilt extends GenericRobot { ClimbCommands climbCommands; IntakeCommands intakecommands; TestCommands testCommands; - - public Rebuilt(String directory) { super(directory); + indexer = new Indexer(); + climb = new Climb(); + intake = new Intake(); + launcher = new Launcher(); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); - indexer = (Indexer) subsystems.get(ConfigConstants.INDEXER); - climb = (Climb) subsystems.get(ConfigConstants.CLIMB); - intake = (Intake) subsystems.get(ConfigConstants.INTAKE); - launcher = (Launcher) subsystems.get(ConfigConstants.LAUNCHER); } @Override public void configureButtonBindings(Controller driver, Controller operator) { indexer.ConfigController(driver); intake.ConfigController(driver); -<<<<<<< Updated upstream climb.ConfigController(driver); - if (DriverStation.isTest ()){ + if (DriverStation.isTest()) { testCommands.configureButtonBindings(driver); - } - else{ + } else { // Add teleop commands here } - -======= - launcher.ConfigController(driver); ->>>>>>> Stashed changes } @Override diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index 790592c1..855b1aee 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -1,22 +1,62 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; +import frc.robot.rebuilt.subsystems.Climb; import java.util.Map; - import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.sensors.Controller; public class ClimbCommands { - private Map subsystems; - - public void ClimbCommands(Map subsystems){ - this.subsystems = subsystems; -} - - - public void configureButtonBindings(Controller controller){ + private Map subsystems; + private StateMachine stateMachine; + private State idleState; + private State elevateState; + private State lowerState; + private Boolean requestState; - } + public ClimbCommands(Map subsystems) { + this.subsystems = subsystems; + // Create a simple state machine for climb and set it as the default command for the Climb + Climb climb = (Climb) subsystems.get(ConfigConstants.CLIMB); + stateMachine = new StateMachine("ClimbStateMachine"); + // a simple idle state; transitions will be added in configureButtonBindings + idleState = stateMachine.addState("idle", Commands.idle()); + // states that actually run the climber + if (climb != null) { + elevateState = stateMachine.addState("elevate", climb.climberCommand(.5)); + lowerState = stateMachine.addState("lower", climb.climberCommand(0)); + } else { + // fallback states if climb isn't available + elevateState = stateMachine.addState("elevate", Commands.idle()); + lowerState = stateMachine.addState("lower", Commands.idle()); + } + + stateMachine.setInitialState(idleState); + + if (climb != null) { + climb.setDefaultCommand(stateMachine); + } + } + + public void configureButtonBindings(Controller controller) { + // create Trigger objects for clarity and reuse + Trigger rightBumper = controller.createRightBumper(); + Trigger leftBumper = controller.createLeftBumper(); + + // idle -> elevate on right bumper press + idleState.switchTo(elevateState).when(rightBumper); + // elevate -> idle when right bumper released + elevateState.switchTo(idleState).when(() -> !rightBumper.getAsBoolean()); + + // idle -> lower on left bumper press + idleState.switchTo(lowerState).when(leftBumper); + // lower -> idle when left bumper released + lowerState.switchTo(idleState).when(() -> !leftBumper.getAsBoolean()); + } } - diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index e715a1b1..5c7fe273 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -4,12 +4,6 @@ package frc.robot.rebuilt.subsystems; -<<<<<<< Updated upstream -import org.frc5010.common.arch.GenericSubsystem; - -public class Launcher extends GenericSubsystem { -======= -import java.util.Map; import edu.wpi.first.units.Units; import edu.wpi.first.units.measure.Angle; import edu.wpi.first.wpilibj2.command.Command; @@ -25,17 +19,14 @@ public class Launcher extends GenericSubsystem { private Arm Hood; private FlyWheel UpperShooter; private FlyWheel LowerShooter; - ->>>>>>> Stashed changes + /** Creates a new Launcher. */ - public Launcher() { super("launcher.json"); Turret = (Pivot) devices.get("turretmotor"); Hood = (Arm) devices.get("hoodmotor"); UpperShooter = (FlyWheel) devices.get("uppershootermotor"); LowerShooter = (FlyWheel) devices.get("lowershootermotor"); - } public void runShooter(double speed) { From 175fea4361bc9fad63572a97abe77e0307f8ca4f Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Wed, 21 Jan 2026 18:46:34 -0500 Subject: [PATCH 040/371] Refactor command constructors and add LauncherCommands Fixed constructors in AutoCommands, ClimbCommands, and TestCommands to use correct Java constructor syntax. Extracted testLauncherCommand and related button bindings from Launcher to a new LauncherCommands class, improving separation of concerns and code organization. --- .../rebuilt/commands/LauncherCommands.java | 123 ++++++++++++++++++ .../robot/rebuilt/subsystems/Launcher.java | 118 +---------------- 2 files changed, 125 insertions(+), 116 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java new file mode 100644 index 00000000..dad646bc --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -0,0 +1,123 @@ +package frc.robot.rebuilt.commands; + +import edu.wpi.first.units.Units; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.subsystems.Launcher; +import java.util.Map; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; + +public class LauncherCommands { + private Launcher launcher; + private Map subsystems; + + public LauncherCommands(Map subsystems) { + this.subsystems = subsystems; + launcher = (Launcher) subsystems.get("launcher"); + } + + public void configureButtonBindings(Controller controller) { + controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); + } + + public Command testLauncherCommand(double speed, double time) { + + return (Commands.run( + () -> { + launcher.runShooter(speed); + }) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.runShooter(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setUpperSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setUpperSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setLowerSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setLowerSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(-90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(-180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(-90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .repeatedly(); + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java index e715a1b1..d9eea01d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java @@ -4,16 +4,7 @@ package frc.robot.rebuilt.subsystems; -<<<<<<< Updated upstream -import org.frc5010.common.arch.GenericSubsystem; - -public class Launcher extends GenericSubsystem { -======= -import java.util.Map; -import edu.wpi.first.units.Units; import edu.wpi.first.units.measure.Angle; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; import yams.mechanisms.positional.Arm; @@ -25,17 +16,14 @@ public class Launcher extends GenericSubsystem { private Arm Hood; private FlyWheel UpperShooter; private FlyWheel LowerShooter; - ->>>>>>> Stashed changes + /** Creates a new Launcher. */ - public Launcher() { super("launcher.json"); Turret = (Pivot) devices.get("turretmotor"); Hood = (Arm) devices.get("hoodmotor"); UpperShooter = (FlyWheel) devices.get("uppershootermotor"); LowerShooter = (FlyWheel) devices.get("lowershootermotor"); - } public void runShooter(double speed) { @@ -59,109 +47,7 @@ public void setTurretRotation(Angle angle) { Turret.getMotorController().setPosition(angle); } - public Command testLauncherCommand(double speed, double time) { - - return (Commands.run( - () -> { - runShooter(speed); - }) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - runShooter(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setUpperSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setUpperSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setLowerSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setLowerSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setHoodAngle(Units.Degrees.of(90)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setHoodAngle(Units.Degrees.of(180)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setHoodAngle(Units.Degrees.of(-90)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setHoodAngle(Units.Degrees.of(-180)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setHoodAngle(Units.Degrees.of(0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setTurretRotation(Units.Degrees.of(90.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setTurretRotation(Units.Degrees.of(180.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setTurretRotation(Units.Degrees.of(-90.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setTurretRotation(Units.Degrees.of(180.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - setTurretRotation(Units.Degrees.of(0)); - })) - .withTimeout(time)) - .repeatedly(); - } - - public void ConfigController(Controller controller) { - controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); - } + public void ConfigController(Controller controller) {} @Override public void periodic() { From 67c26bded038ec7dcff67c1af63a796088926d29 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Wed, 21 Jan 2026 18:54:21 -0500 Subject: [PATCH 041/371] Fix up a few things Co-Authored-By: Curt <15949244+clrozeboom@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 ++ src/main/java/frc/robot/rebuilt/commands/AutoCommands.java | 2 +- src/main/java/frc/robot/rebuilt/commands/TestCommands.java | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 49bf31cb..a02a88f9 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -41,6 +41,7 @@ public Rebuilt(String directory) { intake = new Intake(); launcher = new Launcher(); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); + testCommands = new TestCommands(subsystems); } @Override @@ -53,6 +54,7 @@ public void configureButtonBindings(Controller driver, Controller operator) { testCommands.configureButtonBindings(driver); } else { // Add teleop commands here + testCommands.configureButtonBindings(driver); } } diff --git a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java index a7e95802..2b36c5ef 100644 --- a/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/AutoCommands.java @@ -7,7 +7,7 @@ public class AutoCommands { private Map subsystems; - public void AutoCommands(Map subsystems) { + public AutoCommands(Map subsystems) { this.subsystems = subsystems; } diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index d793a3d0..0fd63908 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -18,7 +18,7 @@ public class TestCommands { Intake intake; Launcher launcher; - public void TestCommands(Map subsystems) { + public TestCommands(Map subsystems) { this.subsystems = subsystems; indexer = (Indexer) subsystems.get(ConfigConstants.INDEXER); climb = (Climb) subsystems.get(ConfigConstants.CLIMB); From de08b6df5f8f6d2494429d1b392de62f9664d1f7 Mon Sep 17 00:00:00 2001 From: Curt Date: Wed, 21 Jan 2026 20:53:41 -0500 Subject: [PATCH 042/371] Refactor subsystem constants and update configs Moved subsystem string constants from ConfigConstants to a new frc.robot.rebuilt.Constants class and updated all references. Added startingPose to akit_swerve_drivetrain.json, included localization.json in cameras.json, and added radius and mass to turret.json. Also set default drivetrain command in Rebuilt.java. --- .../rebuilt_robot/akit_swerve_drivetrain.json | 16 +++++++++++++++- src/main/deploy/rebuilt_robot/cameras.json | 4 +++- .../subsystems/launcher/turret.json | 9 ++++++++- src/main/java/frc/robot/rebuilt/Constants.java | 13 +++++++++++++ src/main/java/frc/robot/rebuilt/Rebuilt.java | 4 +++- .../robot/rebuilt/commands/ClimbCommands.java | 4 ++-- .../robot/rebuilt/commands/LauncherCommands.java | 3 ++- .../frc/robot/rebuilt/commands/TestCommands.java | 10 +++++----- .../frc5010/common/config/ConfigConstants.java | 4 ---- 9 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/Constants.java diff --git a/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json b/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json index 4f295f3a..64ed827d 100644 --- a/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json +++ b/src/main/deploy/rebuilt_robot/akit_swerve_drivetrain.json @@ -159,6 +159,20 @@ "val": 120, "uom": "amps" }, - "canbus": "" + "canbus": "", + "startingPose": { + "x": { + "val": 1.0, + "uom": "m" + }, + "y": { + "val": 1.0, + "uom": "m" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } } } diff --git a/src/main/deploy/rebuilt_robot/cameras.json b/src/main/deploy/rebuilt_robot/cameras.json index bfdc48b6..49999d11 100644 --- a/src/main/deploy/rebuilt_robot/cameras.json +++ b/src/main/deploy/rebuilt_robot/cameras.json @@ -1,3 +1,5 @@ { - "cameras": [] + "cameras": [ + "localization.json" + ] } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index f3750772..e0a21e93 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -53,5 +53,12 @@ "val": 0, "uom": "deg" }, - "moi": 0.001 + "radius": { + "val": 5, + "uom": "in" + }, + "mass": { + "val": 2, + "uom": "lb" + } } diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java new file mode 100644 index 00000000..79269d56 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -0,0 +1,13 @@ +package frc.robot.rebuilt; + +import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Intake; +import frc.robot.rebuilt.subsystems.Launcher; + +public class Constants { + public static final String INDEXER = Indexer.class.getSimpleName(); + public static final String CLIMB = Climb.class.getSimpleName(); + public static final String INTAKE = Intake.class.getSimpleName(); + public static final String LAUNCHER = Launcher.class.getSimpleName(); +} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index a02a88f9..8017d6ac 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -59,7 +59,9 @@ public void configureButtonBindings(Controller driver, Controller operator) { } @Override - public void setupDefaultCommands(Controller driver, Controller operator) {} + public void setupDefaultCommands(Controller driver, Controller operator) { + drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); + } @Override public void initAutoCommands() { diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index 855b1aee..f800f34a 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -2,12 +2,12 @@ import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.Trigger; +import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; -import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.sensors.Controller; public class ClimbCommands { @@ -23,7 +23,7 @@ public ClimbCommands(Map subsystems) { this.subsystems = subsystems; // Create a simple state machine for climb and set it as the default command for the Climb - Climb climb = (Climb) subsystems.get(ConfigConstants.CLIMB); + Climb climb = (Climb) subsystems.get(Constants.CLIMB); stateMachine = new StateMachine("ClimbStateMachine"); // a simple idle state; transitions will be added in configureButtonBindings idleState = stateMachine.addState("idle", Commands.idle()); diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index dad646bc..16b6d2d4 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -3,6 +3,7 @@ import edu.wpi.first.units.Units; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Launcher; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; @@ -14,7 +15,7 @@ public class LauncherCommands { public LauncherCommands(Map subsystems) { this.subsystems = subsystems; - launcher = (Launcher) subsystems.get("launcher"); + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); } public void configureButtonBindings(Controller controller) { diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 0fd63908..affe312f 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -1,12 +1,12 @@ package frc.robot.rebuilt.commands; +import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.sensors.Controller; public class TestCommands { @@ -20,10 +20,10 @@ public class TestCommands { public TestCommands(Map subsystems) { this.subsystems = subsystems; - indexer = (Indexer) subsystems.get(ConfigConstants.INDEXER); - climb = (Climb) subsystems.get(ConfigConstants.CLIMB); - intake = (Intake) subsystems.get(ConfigConstants.INTAKE); - launcher = (Launcher) subsystems.get(ConfigConstants.LAUNCHER); + indexer = (Indexer) subsystems.get(Constants.INDEXER); + climb = (Climb) subsystems.get(Constants.CLIMB); + intake = (Intake) subsystems.get(Constants.INTAKE); + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); } public void configureButtonBindings(Controller controller) { diff --git a/src/main/java/org/frc5010/common/config/ConfigConstants.java b/src/main/java/org/frc5010/common/config/ConfigConstants.java index 68e8c9c2..cc622b0b 100644 --- a/src/main/java/org/frc5010/common/config/ConfigConstants.java +++ b/src/main/java/org/frc5010/common/config/ConfigConstants.java @@ -4,10 +4,6 @@ public class ConfigConstants { public static final String GYRO = "gyro"; public static final String DRIVETRAIN = "drivetrain"; - public static final String INDEXER = "indexer"; - public static final String CLIMB = "climb"; - public static final String INTAKE = "intake"; - public static final String LAUNCHER = "launcher"; public static final String ALL_LEDS = "all_leds"; } From 0649a8b4b3c9e8e68e6593d12f8723c11949ebb2 Mon Sep 17 00:00:00 2001 From: Curt Date: Thu, 22 Jan 2026 12:55:57 -0500 Subject: [PATCH 043/371] Refactor button binding configuration methods Moved climb command bindings to configureButtonBindings and test command bindings to a new configureAltButtonBindings method. Removed unused DriverStation import and simplified button binding logic for better separation of teleop and test mode configurations. --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 8017d6ac..3c49b912 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,7 +4,6 @@ package frc.robot.rebuilt; -import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; @@ -46,16 +45,13 @@ public Rebuilt(String directory) { @Override public void configureButtonBindings(Controller driver, Controller operator) { - indexer.ConfigController(driver); - intake.ConfigController(driver); - climb.ConfigController(driver); + climbCommands.configureButtonBindings(operator); + } - if (DriverStation.isTest()) { - testCommands.configureButtonBindings(driver); - } else { - // Add teleop commands here - testCommands.configureButtonBindings(driver); - } + @Override + public void configureAltButtonBindings(Controller driver, Controller operator) { + // Add test mode specific button bindings here + testCommands.configureButtonBindings(driver); } @Override From 3ee34e96f5705c6df0568b4216ce9ddf22d3dec9 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Fri, 23 Jan 2026 18:00:06 -0500 Subject: [PATCH 044/371] Simulator Fix Climb commands Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> Co-Authored-By: cjayamanne <162512395+cjayamanne@users.noreply.github.com> --- simgui-ds.json | 3 ++- simgui.json | 9 ++++----- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- src/main/java/frc/robot/rebuilt/Rebuilt.java | 5 +---- .../java/frc/robot/rebuilt/commands/ClimbCommands.java | 4 ++-- 5 files changed, 14 insertions(+), 17 deletions(-) diff --git a/simgui-ds.json b/simgui-ds.json index 01e79d2a..4abf5597 100644 --- a/simgui-ds.json +++ b/simgui-ds.json @@ -97,7 +97,8 @@ ], "robotJoysticks": [ { - "guid": "Keyboard0" + "guid": "78696e70757401000000000000000000", + "useGamepad": true } ] } diff --git a/simgui.json b/simgui.json index 66cbe626..1cea73e1 100644 --- a/simgui.json +++ b/simgui.json @@ -176,8 +176,12 @@ "/SmartDashboard/Turret/mechanism": "Mechanism2d", "/SmartDashboard/VisionSystemSim-Vision/Sim Field": "Field2d", "/SmartDashboard/VisionSystemSim-main/Sim Field": "Field2d", + "/SmartDashboard/hoodmotor/mechanism": "Mechanism2d", + "/SmartDashboard/lowershootermotor/mechanism": "Mechanism2d", "/SmartDashboard/navX-Sensor[1]": "Gyro", "/SmartDashboard/navX-Sensor[4]": "Gyro", + "/SmartDashboard/turretmotor/mechanism": "Mechanism2d", + "/SmartDashboard/uppershootermotor/mechanism": "Mechanism2d", "/SmartDashboard/winch_motor/mechanism": "Mechanism2d" }, "windows": { @@ -922,11 +926,6 @@ "visible": true } }, - "/SmartDashboard/TigerShark/Auto Modes": { - "window": { - "visible": true - } - }, "/SmartDashboard/VisionSystemSim-main/Sim Field": { "bottom": 1914, "height": 8.069275856018066, diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 3bdbefab..87e11bce 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 144; - public static final String GIT_SHA = "ff17e204f8f65c364995b112e94af09d94fc1bab"; - public static final String GIT_DATE = "2026-01-21 17:59:29 EST"; + public static final int GIT_REVISION = 155; + public static final String GIT_SHA = "0649a8b4b3c9e8e68e6593d12f8723c11949ebb2"; + public static final String GIT_DATE = "2026-01-22 12:55:57 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-21 18:33:04 EST"; - public static final long BUILD_UNIX_TIME = 1769038384705L; + public static final String BUILD_DATE = "2026-01-23 17:55:57 EST"; + public static final long BUILD_UNIX_TIME = 1769208957272L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 3c49b912..57e529fc 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -6,9 +6,7 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.AutoCommands; import frc.robot.rebuilt.commands.ClimbCommands; -import frc.robot.rebuilt.commands.IntakeCommands; import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; @@ -28,9 +26,7 @@ public class Rebuilt extends GenericRobot { Climb climb; Intake intake; Launcher launcher; - AutoCommands autocommands; ClimbCommands climbCommands; - IntakeCommands intakecommands; TestCommands testCommands; public Rebuilt(String directory) { @@ -41,6 +37,7 @@ public Rebuilt(String directory) { launcher = new Launcher(); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); testCommands = new TestCommands(subsystems); + climbCommands = new ClimbCommands(subsystems); } @Override diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index f800f34a..d471c49e 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -39,9 +39,9 @@ public ClimbCommands(Map subsystems) { stateMachine.setInitialState(idleState); - if (climb != null) { + /* if (climb != null) { climb.setDefaultCommand(stateMachine); - } + }*/ } public void configureButtonBindings(Controller controller) { From 21cfb192ba58d6880775db8551ec19b88bc129e6 Mon Sep 17 00:00:00 2001 From: 5010 FHS 5 Date: Fri, 23 Jan 2026 18:40:28 -0500 Subject: [PATCH 045/371] launcher Co-Authored-By: CameronSkea <233858202+CameronSkea@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 45 ++++++++------- .../rebuilt/commands/LauncherCommands.java | 55 +++++++++++++++++-- .../org/frc5010/common/arch/StateMachine.java | 10 ++++ 3 files changed, 85 insertions(+), 25 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 3c49b912..7a84babc 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,6 +4,13 @@ package frc.robot.rebuilt; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; + +import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; @@ -14,11 +21,6 @@ import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; -import org.frc5010.common.arch.GenericRobot; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.sensors.Controller; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { @@ -32,32 +34,35 @@ public class Rebuilt extends GenericRobot { ClimbCommands climbCommands; IntakeCommands intakecommands; TestCommands testCommands; + + public Rebuilt(String directory) { super(directory); - indexer = new Indexer(); - climb = new Climb(); - intake = new Intake(); - launcher = new Launcher(); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); - testCommands = new TestCommands(subsystems); + indexer = (Indexer) subsystems.get(Constants.INDEXER); + climb = (Climb) subsystems.get(Constants.CLIMB); + intake = (Intake) subsystems.get(Constants.INTAKE); + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); } @Override public void configureButtonBindings(Controller driver, Controller operator) { - climbCommands.configureButtonBindings(operator); - } + indexer.ConfigController(driver); + intake.ConfigController(driver); + climb.ConfigController(driver); - @Override - public void configureAltButtonBindings(Controller driver, Controller operator) { - // Add test mode specific button bindings here - testCommands.configureButtonBindings(driver); - } + if (DriverStation.isTest ()){ + testCommands.configureButtonBindings(driver); + } + else{ + // Add teleop commands here + } + + } @Override - public void setupDefaultCommands(Controller driver, Controller operator) { - drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); - } + public void setupDefaultCommands(Controller driver, Controller operator) {} @Override public void initAutoCommands() { diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index 16b6d2d4..db917cb8 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,26 +1,71 @@ package frc.robot.rebuilt.commands; +import java.util.Map; + +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.sensors.Controller; + import edu.wpi.first.units.Units; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Launcher; -import java.util.Map; -import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.sensors.Controller; +import yams.mechanisms.positional.Arm; public class LauncherCommands { + + private StateMachine stateMachine; + private State lowState; + private State prepState; + private State readyState; + private Arm hood; private Launcher launcher; private Map subsystems; public LauncherCommands(Map subsystems) { + this.subsystems = subsystems; - launcher = (Launcher) subsystems.get(Constants.LAUNCHER); + + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); + stateMachine = new StateMachine("LauncherStateMachine"); + + lowState = stateMachine.addState("LOW-SPEED", Commands.idle()); } public void configureButtonBindings(Controller controller) { + + if (launcher != null){ + launcher.setDefaultCommand(stateMachine); + } + controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); - } + + Trigger rightBumper = controller.createRightBumper(); + Trigger leftBumper = controller.createLeftBumper(); + + lowState.switchTo(prepState).when(rightBumper); + prepState.switchTo(lowState).when(() -> !rightBumper.getAsBoolean()); + + prepState.switchTo(readyState).when(leftBumper); + readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); + + + if (lowState != null && lowState.isActive() ) { + + launcher.setHoodAngle(Units.Degrees.of(0)); + launcher.setLowerSpeed(0.5); + launcher.setTurretRotation(Units.Degrees.of(0)); + + } + } + + + + + public Command testLauncherCommand(double speed, double time) { diff --git a/src/main/java/org/frc5010/common/arch/StateMachine.java b/src/main/java/org/frc5010/common/arch/StateMachine.java index a68fd114..5c077375 100644 --- a/src/main/java/org/frc5010/common/arch/StateMachine.java +++ b/src/main/java/org/frc5010/common/arch/StateMachine.java @@ -445,6 +445,16 @@ private void checkDuplicateCondition(BooleanSupplier condition) { } } } // end class NeedsConditionTransitionBuilder + + public Object switchto(State pREPPING) { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'switchto'"); + } + + public boolean isActive() { + // TODO Auto-generated method stub + throw new UnsupportedOperationException("Unimplemented method 'isActive'"); + } } // end class State /** class Transition is a Triggering external event to change to the next command (state) */ From b786b94caa1d93fbc832d1cf3894e9ab2f1366cf Mon Sep 17 00:00:00 2001 From: Curt Date: Fri, 23 Jan 2026 21:13:42 -0500 Subject: [PATCH 046/371] Refactor subsystem initialization and update commands Reorganized subsystem initialization in Rebuilt.java to use direct instantiation and updated command classes to use subsystems from the map. Improved button binding configuration and default command setup. Cleaned up StateMachine by removing unused methods. Updated vendordep files for ThriftyLib and YAMS to new versions. --- src/main/java/frc/robot/rebuilt/Rebuilt.java | 48 +++++++++---------- .../rebuilt/commands/IntakeCommands.java | 10 ++-- .../rebuilt/commands/LauncherCommands.java | 39 +++++++-------- .../org/frc5010/common/arch/StateMachine.java | 10 ---- ...Lib-2026.0.0.json => ThriftyLib-2026.json} | 6 +-- vendordeps/yams.json | 4 +- 6 files changed, 49 insertions(+), 68 deletions(-) rename vendordeps/{ThriftyLib-2026.0.0.json => ThriftyLib-2026.json} (81%) diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 7a84babc..4b8ce010 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -4,13 +4,6 @@ package frc.robot.rebuilt; -import org.frc5010.common.arch.GenericRobot; -import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; -import org.frc5010.common.drive.GenericDrivetrain; -import org.frc5010.common.sensors.Controller; - -import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.AutoCommands; @@ -21,6 +14,11 @@ import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import org.frc5010.common.arch.GenericRobot; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.constants.SwerveConstants; +import org.frc5010.common.drive.GenericDrivetrain; +import org.frc5010.common.sensors.Controller; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { @@ -34,35 +32,35 @@ public class Rebuilt extends GenericRobot { ClimbCommands climbCommands; IntakeCommands intakecommands; TestCommands testCommands; - - public Rebuilt(String directory) { super(directory); + indexer = new Indexer(); + climb = new Climb(); + intake = new Intake(); + launcher = new Launcher(); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); - indexer = (Indexer) subsystems.get(Constants.INDEXER); - climb = (Climb) subsystems.get(Constants.CLIMB); - intake = (Intake) subsystems.get(Constants.INTAKE); - launcher = (Launcher) subsystems.get(Constants.LAUNCHER); + testCommands = new TestCommands(subsystems); + climbCommands = new ClimbCommands(subsystems); + // intakecommands = new IntakeCommands(subsystems); } @Override public void configureButtonBindings(Controller driver, Controller operator) { - indexer.ConfigController(driver); - intake.ConfigController(driver); - climb.ConfigController(driver); + testCommands.configureButtonBindings(driver); + climbCommands.configureButtonBindings(operator); + } - if (DriverStation.isTest ()){ - testCommands.configureButtonBindings(driver); - } - else{ - // Add teleop commands here - } - - } + @Override + public void configureAltButtonBindings(Controller driver, Controller operator) { + // Add test mode specific button bindings here + testCommands.configureButtonBindings(driver); + } @Override - public void setupDefaultCommands(Controller driver, Controller operator) {} + public void setupDefaultCommands(Controller driver, Controller operator) { + drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); + } @Override public void initAutoCommands() { diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index 0ee4cccd..3934e7fe 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -1,6 +1,7 @@ package frc.robot.rebuilt.commands; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import java.util.Map; @@ -11,13 +12,12 @@ public class IntakeCommands { Indexer indexer; Intake intake; - Map intakeMap; + Map subsystems; StateMachine intakeStateMachine = new StateMachine("IntakeStateMachine"); - public IntakeCommands(Map intakeMap) { - this.intakeMap = intakeMap; - indexer = new Indexer(); - intake = new Intake(); + public IntakeCommands(Map subsystems) { + this.subsystems = subsystems; + intake = (Intake) subsystems.get(Constants.INTAKE); } State retracting = diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index db917cb8..b80b573e 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -28,16 +28,16 @@ public class LauncherCommands { public LauncherCommands(Map subsystems) { this.subsystems = subsystems; - - launcher = (Launcher) subsystems.get(Constants.LAUNCHER); - stateMachine = new StateMachine("LauncherStateMachine"); - lowState = stateMachine.addState("LOW-SPEED", Commands.idle()); + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); + stateMachine = new StateMachine("LauncherStateMachine"); + + lowState = stateMachine.addState("LOW-SPEED", Commands.idle()); } public void configureButtonBindings(Controller controller) { - if (launcher != null){ + if (launcher != null) { launcher.setDefaultCommand(stateMachine); } @@ -46,26 +46,19 @@ public void configureButtonBindings(Controller controller) { Trigger rightBumper = controller.createRightBumper(); Trigger leftBumper = controller.createLeftBumper(); - lowState.switchTo(prepState).when(rightBumper); - prepState.switchTo(lowState).when(() -> !rightBumper.getAsBoolean()); + lowState.switchTo(prepState).when(rightBumper); + prepState.switchTo(lowState).when(() -> !rightBumper.getAsBoolean()); prepState.switchTo(readyState).when(leftBumper); - readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); - - - if (lowState != null && lowState.isActive() ) { - - launcher.setHoodAngle(Units.Degrees.of(0)); - launcher.setLowerSpeed(0.5); - launcher.setTurretRotation(Units.Degrees.of(0)); - - } - } - - - - - + readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); + + if (lowState != null && lowState.isScheduled()) { + + launcher.setHoodAngle(Units.Degrees.of(0)); + launcher.setLowerSpeed(0.5); + launcher.setTurretRotation(Units.Degrees.of(0)); + } + } public Command testLauncherCommand(double speed, double time) { diff --git a/src/main/java/org/frc5010/common/arch/StateMachine.java b/src/main/java/org/frc5010/common/arch/StateMachine.java index 5c077375..a68fd114 100644 --- a/src/main/java/org/frc5010/common/arch/StateMachine.java +++ b/src/main/java/org/frc5010/common/arch/StateMachine.java @@ -445,16 +445,6 @@ private void checkDuplicateCondition(BooleanSupplier condition) { } } } // end class NeedsConditionTransitionBuilder - - public Object switchto(State pREPPING) { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'switchto'"); - } - - public boolean isActive() { - // TODO Auto-generated method stub - throw new UnsupportedOperationException("Unimplemented method 'isActive'"); - } } // end class State /** class Transition is a Triggering external event to change to the next command (state) */ diff --git a/vendordeps/ThriftyLib-2026.0.0.json b/vendordeps/ThriftyLib-2026.json similarity index 81% rename from vendordeps/ThriftyLib-2026.0.0.json rename to vendordeps/ThriftyLib-2026.json index 2ff6a4c2..5b4f67ce 100644 --- a/vendordeps/ThriftyLib-2026.0.0.json +++ b/vendordeps/ThriftyLib-2026.json @@ -1,7 +1,7 @@ { - "fileName": "ThriftyLib-2026.0.0.json", + "fileName": "ThriftyLib-2026.json", "name": "ThriftyLib", - "version": "2026.0.0", + "version": "2026.0.1", "frcYear": "2026", "uuid": "60b2694b-9e6e-4026-81ee-6f167946f4b0", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "com.thethriftybot.frc", "artifactId": "ThriftyLib-java", - "version": "2026.0.0" + "version": "2026.0.1" } ], "jniDependencies": [], diff --git a/vendordeps/yams.json b/vendordeps/yams.json index 5323d382..c2944828 100644 --- a/vendordeps/yams.json +++ b/vendordeps/yams.json @@ -1,7 +1,7 @@ { "fileName": "yams.json", "name": "Yet Another Mechanism System", - "version": "2026.1.17", + "version": "2026.1.23", "frcYear": "2026", "uuid": "a1051e86-a979-4880-a28b-a0d5362d1d96", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "yams", "artifactId": "YAMS-java", - "version": "2026.1.17" + "version": "2026.1.23" } ], "cppDependencies": [], From 66c83704644465b623f6fdfa523fbfcc59fd2cd2 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 24 Jan 2026 11:21:30 -0500 Subject: [PATCH 047/371] Simulator issue fix with setdefaultcommand Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- .../java/frc/robot/rebuilt/commands/ClimbCommands.java | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 87e11bce..536bca37 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 155; - public static final String GIT_SHA = "0649a8b4b3c9e8e68e6593d12f8723c11949ebb2"; - public static final String GIT_DATE = "2026-01-22 12:55:57 EST"; + public static final int GIT_REVISION = 156; + public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; + public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-23 17:55:57 EST"; - public static final long BUILD_UNIX_TIME = 1769208957272L; + public static final String BUILD_DATE = "2026-01-23 18:26:53 EST"; + public static final long BUILD_UNIX_TIME = 1769210813704L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index d471c49e..f179cbeb 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -39,9 +39,10 @@ public ClimbCommands(Map subsystems) { stateMachine.setInitialState(idleState); - /* if (climb != null) { + if (climb != null) { + stateMachine.addRequirements(climb); climb.setDefaultCommand(stateMachine); - }*/ + } } public void configureButtonBindings(Controller controller) { From 6fbd80fe57a19830ff9c7704cdb22a0440dfdd2e Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 24 Jan 2026 11:37:04 -0500 Subject: [PATCH 048/371] Refactor Launcher subsystem to use IO abstraction Moved Launcher class to a dedicated Launcher package and introduced LauncherIO, LauncherIOReal, and LauncherIOSim for hardware abstraction. Updated all imports and references to the new package structure. Added logging of IO inputs in the periodic method to support better simulation and hardware separation. --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- src/main/java/frc/robot/rebuilt/Constants.java | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../robot/rebuilt/commands/LauncherCommands.java | 2 +- .../frc/robot/rebuilt/commands/TestCommands.java | 2 +- .../rebuilt/subsystems/{ => Launcher}/Launcher.java | 13 ++++++++++--- .../rebuilt/subsystems/Launcher/LauncherIO.java | 12 ++++++++++++ .../rebuilt/subsystems/Launcher/LauncherIOReal.java | 8 ++++++++ .../rebuilt/subsystems/Launcher/LauncherIOSim.java | 10 ++++++++++ 9 files changed, 49 insertions(+), 12 deletions(-) rename src/main/java/frc/robot/rebuilt/subsystems/{ => Launcher}/Launcher.java (84%) create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 87e11bce..52da9925 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 155; - public static final String GIT_SHA = "0649a8b4b3c9e8e68e6593d12f8723c11949ebb2"; - public static final String GIT_DATE = "2026-01-22 12:55:57 EST"; + public static final int GIT_REVISION = 156; + public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; + public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-23 17:55:57 EST"; - public static final long BUILD_UNIX_TIME = 1769208957272L; + public static final String BUILD_DATE = "2026-01-23 18:19:50 EST"; + public static final long BUILD_UNIX_TIME = 1769210390226L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index 79269d56..f79c870d 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -3,7 +3,7 @@ import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; -import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; public class Constants { public static final String INDEXER = Indexer.class.getSimpleName(); diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 57e529fc..49fc0fbe 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -11,7 +11,7 @@ import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; -import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.constants.SwerveConstants; diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index 16b6d2d4..b0bf84fc 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -4,7 +4,7 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index affe312f..c9e3e446 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -4,7 +4,7 @@ import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; -import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java similarity index 84% rename from src/main/java/frc/robot/rebuilt/subsystems/Launcher.java rename to src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index d9eea01d..c63f17c1 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -2,16 +2,20 @@ // 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. -package frc.robot.rebuilt.subsystems; +package frc.robot.rebuilt.subsystems.Launcher; -import edu.wpi.first.units.measure.Angle; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.Logger; + +import edu.wpi.first.units.measure.Angle; import yams.mechanisms.positional.Arm; import yams.mechanisms.positional.Pivot; import yams.mechanisms.velocity.FlyWheel; public class Launcher extends GenericSubsystem { + private final LauncherIO io; + private final LauncherIOInputsAutoLogged inputs = new LauncherIOInputsAutoLogged(); private Pivot Turret; private Arm Hood; private FlyWheel UpperShooter; @@ -20,6 +24,7 @@ public class Launcher extends GenericSubsystem { /** Creates a new Launcher. */ public Launcher() { super("launcher.json"); + io = new LauncherIO() {}; Turret = (Pivot) devices.get("turretmotor"); Hood = (Arm) devices.get("hoodmotor"); UpperShooter = (FlyWheel) devices.get("uppershootermotor"); @@ -49,10 +54,12 @@ public void setTurretRotation(Angle angle) { public void ConfigController(Controller controller) {} + @Override public void periodic() { - // This method will be called once per scheduler run super.periodic(); + io.updateInputs(inputs); + Logger.processInputs("Launcher", inputs); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java new file mode 100644 index 00000000..50f5171c --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java @@ -0,0 +1,12 @@ +package frc.robot.rebuilt.subsystems.Launcher; + +import org.littletonrobotics.junction.AutoLog; + +/** IO interface for the Launcher subsystem. */ +public interface LauncherIO { + + @AutoLog + public static class LauncherIOInputs {} + + public default void updateInputs(LauncherIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java new file mode 100644 index 00000000..c1812ba2 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -0,0 +1,8 @@ +// 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. + +package frc.robot.rebuilt.subsystems.Launcher; + +/** Add your docs here. */ +public class LauncherIOReal implements LauncherIO {} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java new file mode 100644 index 00000000..ddd61107 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java @@ -0,0 +1,10 @@ +// 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. + +package frc.robot.rebuilt.subsystems.Launcher; + +/** Add your docs here. */ +public class LauncherIOSim extends LauncherIOReal { + +} From 5a3439b6ec98607462c716e559a23e1fbaff61c3 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 24 Jan 2026 13:00:12 -0500 Subject: [PATCH 049/371] Added IO adjustments to Climb I also put everything in a climb folder within subsystems for organization --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- .../java/frc/robot/rebuilt/Constants.java | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../robot/rebuilt/commands/ClimbCommands.java | 2 +- .../rebuilt/commands/LauncherCommands.java | 10 ++-------- .../robot/rebuilt/commands/TestCommands.java | 2 +- .../rebuilt/subsystems/{ => Climb}/Climb.java | 20 +++++++++++++++---- .../rebuilt/subsystems/Climb/ClimbIO.java | 12 +++++++++++ .../rebuilt/subsystems/Climb/ClimbIOReal.java | 20 +++++++++++++++++++ .../rebuilt/subsystems/Climb/ClimbIOSim.java | 17 ++++++++++++++++ .../rebuilt/subsystems/Launcher/Launcher.java | 11 ++++++---- .../subsystems/Launcher/LauncherIOReal.java | 14 ++++++++++++- .../subsystems/Launcher/LauncherIOSim.java | 7 +++++++ 13 files changed, 103 insertions(+), 26 deletions(-) rename src/main/java/frc/robot/rebuilt/subsystems/{ => Climb}/Climb.java (70%) create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOSim.java diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 52da9925..8e7a8cb4 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 156; - public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; - public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; + public static final int GIT_REVISION = 162; + public static final String GIT_SHA = "51bc9f46b4cba7b1349028d57a01b828e43236e5"; + public static final String GIT_DATE = "2026-01-24 11:42:16 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-23 18:19:50 EST"; - public static final long BUILD_UNIX_TIME = 1769210390226L; + public static final String BUILD_DATE = "2026-01-24 12:53:54 EST"; + public static final long BUILD_UNIX_TIME = 1769277234262L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index f79c870d..f44a5bf4 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -1,6 +1,6 @@ package frc.robot.rebuilt; -import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 04c2b676..b11ec91f 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -10,7 +10,7 @@ import frc.robot.rebuilt.commands.ClimbCommands; import frc.robot.rebuilt.commands.IntakeCommands; import frc.robot.rebuilt.commands.TestCommands; -import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index f179cbeb..e1ca0d26 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -3,7 +3,7 @@ import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Climb.Climb; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index 3b059957..f5d768ae 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,12 +1,5 @@ package frc.robot.rebuilt.commands; -import java.util.Map; - -import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.arch.StateMachine; -import org.frc5010.common.arch.StateMachine.State; -import org.frc5010.common.sensors.Controller; - import edu.wpi.first.units.Units; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; @@ -15,8 +8,9 @@ import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; import org.frc5010.common.sensors.Controller; -import frc.robot.rebuilt.subsystems.Launcher; import yams.mechanisms.positional.Arm; public class LauncherCommands { diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index c9e3e446..84eaf14c 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -1,7 +1,7 @@ package frc.robot.rebuilt.commands; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Climb; +import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java similarity index 70% rename from src/main/java/frc/robot/rebuilt/subsystems/Climb.java rename to src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 7a0a5e4b..3eee3f2e 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -2,20 +2,26 @@ // 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. -package frc.robot.rebuilt.subsystems; +package frc.robot.rebuilt.subsystems.Climb; import static edu.wpi.first.units.Units.Meters; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; + import edu.wpi.first.units.measure.Distance; +import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.sensors.Controller; +import frc.robot.rebuilt.subsystems.Launcher.LauncherIOReal; +import frc.robot.rebuilt.subsystems.Launcher.LauncherIOSim; import yams.mechanisms.positional.Elevator; public class Climb extends GenericSubsystem { /** Creates a new Climb. */ private static Elevator climber; + private final ClimbIO io; + private final ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); public Command climberCommand(double height) { return Commands.run( @@ -34,8 +40,14 @@ public void ConfigController(Controller controller) { public Climb() { super("climb.json"); - climber = (Elevator) devices.get("Climb"); + if (RobotBase.isSimulation()) { + io = new ClimbIOSim(devices); + } else { + io = new ClimbIOReal(devices); + climber = (Elevator) devices.get("Climb"); } +} + public void setHeight(double height) { Distance mydist = Meters.of(height); diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java new file mode 100644 index 00000000..9e18d3ad --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java @@ -0,0 +1,12 @@ +package frc.robot.rebuilt.subsystems.Climb; + +import org.littletonrobotics.junction.AutoLog; + +/** IO interface for the Launcher subsystem. */ +public interface ClimbIO { + + @AutoLog + public static class ClimbIOInputs {} + + public default void updateInputs(ClimbIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java new file mode 100644 index 00000000..ee5575c8 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java @@ -0,0 +1,20 @@ +// 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. + +package frc.robot.rebuilt.subsystems.Climb; + +import java.util.Map; + +/** Add your docs here. */ +public class ClimbIOReal implements ClimbIO { + + protected Map devices; + + public ClimbIOReal(Map devices) { + this.devices = devices; + } + + @Override + public void updateInputs(ClimbIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOSim.java new file mode 100644 index 00000000..b1cfa642 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOSim.java @@ -0,0 +1,17 @@ +// 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. + +package frc.robot.rebuilt.subsystems.Climb; + +import java.util.Map; + +/** Add your docs here. */ +public class ClimbIOSim extends ClimbIOReal { + + protected Map devices; + + public ClimbIOSim(Map devices) { + super(devices); + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index c63f17c1..302cba89 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -4,11 +4,11 @@ package frc.robot.rebuilt.subsystems.Launcher; +import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.wpilibj.RobotBase; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; - -import edu.wpi.first.units.measure.Angle; import yams.mechanisms.positional.Arm; import yams.mechanisms.positional.Pivot; import yams.mechanisms.velocity.FlyWheel; @@ -24,11 +24,15 @@ public class Launcher extends GenericSubsystem { /** Creates a new Launcher. */ public Launcher() { super("launcher.json"); - io = new LauncherIO() {}; Turret = (Pivot) devices.get("turretmotor"); Hood = (Arm) devices.get("hoodmotor"); UpperShooter = (FlyWheel) devices.get("uppershootermotor"); LowerShooter = (FlyWheel) devices.get("lowershootermotor"); + if (RobotBase.isSimulation()) { + io = new LauncherIOSim(devices); + } else { + io = new LauncherIOReal(devices); + } } public void runShooter(double speed) { @@ -54,7 +58,6 @@ public void setTurretRotation(Angle angle) { public void ConfigController(Controller controller) {} - @Override public void periodic() { super.periodic(); diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index c1812ba2..680ea460 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -4,5 +4,17 @@ package frc.robot.rebuilt.subsystems.Launcher; +import java.util.Map; + /** Add your docs here. */ -public class LauncherIOReal implements LauncherIO {} +public class LauncherIOReal implements LauncherIO { + + protected Map devices; + + public LauncherIOReal(Map devices) { + this.devices = devices; + } + + @Override + public void updateInputs(LauncherIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java index ddd61107..bab342b9 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java @@ -4,7 +4,14 @@ package frc.robot.rebuilt.subsystems.Launcher; +import java.util.Map; + /** Add your docs here. */ public class LauncherIOSim extends LauncherIOReal { + protected Map devices; + + public LauncherIOSim(Map devices) { + super(devices); + } } From cdb401ee1fea97d9618fdeea8f042a2c1f2b84a5 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 24 Jan 2026 13:03:44 -0500 Subject: [PATCH 050/371] Fixed Mistake in ClimbIO changes --- .../frc/robot/rebuilt/subsystems/Climb/Climb.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 3eee3f2e..73a15ee5 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -8,13 +8,14 @@ import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.Logger; import edu.wpi.first.units.measure.Distance; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.subsystems.Launcher.LauncherIOReal; -import frc.robot.rebuilt.subsystems.Launcher.LauncherIOSim; +import frc.robot.rebuilt.subsystems.Climb.ClimbIOReal; +import frc.robot.rebuilt.subsystems.Climb.ClimbIOSim; import yams.mechanisms.positional.Elevator; public class Climb extends GenericSubsystem { @@ -53,4 +54,12 @@ public void setHeight(double height) { Distance mydist = Meters.of(height); climber.getMotorController().setPosition(mydist); } + + + @Override + public void periodic() { + super.periodic(); + io.updateInputs(inputs); + Logger.processInputs("Climb", inputs); + } } From 4eaf0bb881e9b48624ed6f182c8f406917c4c446 Mon Sep 17 00:00:00 2001 From: Your Name <162905778+AkhilPalukuru@users.noreply.github.com> Date: Sat, 24 Jan 2026 14:09:38 -0500 Subject: [PATCH 051/371] Refactor Indexer subsystem with IO abstraction Introduced IndexerIO interface and its real and simulation implementations to abstract hardware interactions in the Indexer subsystem. Updated Indexer to use the new IO layer and log inputs, improving modularity and testability. Removed the old IndexerCommands file. --- src/main/java/frc/robot/BuildConstants.java | 12 ++++++------ .../frc/robot/rebuilt/commands/IndexerCommands | 0 .../frc/robot/rebuilt/commands/IndexerIO.java | 11 +++++++++++ .../frc/robot/rebuilt/commands/IndexerIOReal.java | 14 ++++++++++++++ .../frc/robot/rebuilt/commands/IndexerIOSim.java | 11 +++++++++++ .../frc/robot/rebuilt/subsystems/Indexer.java | 15 +++++++++++++++ 6 files changed, 57 insertions(+), 6 deletions(-) delete mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerCommands create mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerIO.java create mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java create mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 87e11bce..87b04bac 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "Rebuilt2026"; + public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 155; - public static final String GIT_SHA = "0649a8b4b3c9e8e68e6593d12f8723c11949ebb2"; - public static final String GIT_DATE = "2026-01-22 12:55:57 EST"; + public static final int GIT_REVISION = 156; + public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; + public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-23 17:55:57 EST"; - public static final long BUILD_UNIX_TIME = 1769208957272L; + public static final String BUILD_DATE = "2026-01-24 14:07:28 EST"; + public static final long BUILD_UNIX_TIME = 1769281648863L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands deleted file mode 100644 index e69de29b..00000000 diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIO.java b/src/main/java/frc/robot/rebuilt/commands/IndexerIO.java new file mode 100644 index 00000000..d595f8fb --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerIO.java @@ -0,0 +1,11 @@ +package frc.robot.rebuilt.commands; + +import org.littletonrobotics.junction.AutoLog; + +public interface IndexerIO { + @AutoLog + public static class IndexerIOInputs {} + + public default void updateInputs(IndexerIOInputs inputs) {} + ; +} diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java new file mode 100644 index 00000000..9bb2bf2e --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java @@ -0,0 +1,14 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +public class IndexerIOReal implements IndexerIO { + protected Map devices; + + public IndexerIOReal(Map devices) { + this.devices = devices; + } + + @Override + public void updateInputs(IndexerIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java b/src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java new file mode 100644 index 00000000..d6452130 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java @@ -0,0 +1,11 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +public class IndexerIOSim extends IndexerIOReal { + protected Map devices; + + public IndexerIOSim(Map devices) { + super(devices); + } +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java index c267c2d9..242a4c96 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java @@ -4,14 +4,22 @@ package frc.robot.rebuilt.subsystems; +import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.commands.IndexerIO; +import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; +import frc.robot.rebuilt.commands.IndexerIOReal; +import frc.robot.rebuilt.commands.IndexerIOSim; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.Logger; public class Indexer extends GenericSubsystem { private PercentControlMotor Spindexer; + private final IndexerIO io; + private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); private PercentControlMotor Feeder; /** Creates a new Index. */ @@ -19,6 +27,11 @@ public Indexer() { super("indexer.json"); Spindexer = (PercentControlMotor) devices.get("spindexer"); Feeder = (PercentControlMotor) devices.get("feeder"); + if (RobotBase.isSimulation()) { + io = new IndexerIOSim(devices); + } else { + io = new IndexerIOReal(devices); + } } public void RunSpindexer(double speed) { @@ -60,6 +73,8 @@ public Command spindexerCommand(double speed) { public void periodic() { // This method will be called once per scheduler run super.periodic(); + io.updateInputs(inputs); + Logger.processInputs("Indexer", inputs); } @Override From 16702378ba6205fb574174f14b2e81cb0b8c489c Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 24 Jan 2026 14:13:14 -0500 Subject: [PATCH 052/371] Fixed Launcher States and made it more trackable --- simgui.json | 33 ++-- src/main/java/frc/robot/rebuilt/Rebuilt.java | 8 +- .../robot/rebuilt/commands/ClimbCommands.java | 4 +- .../rebuilt/commands/LauncherCommands.java | 144 +++++------------- .../robot/rebuilt/commands/TestCommands.java | 105 +++++++++++++ .../robot/rebuilt/subsystems/Climb/Climb.java | 24 ++- .../frc/robot/rebuilt/subsystems/Indexer.java | 4 +- 7 files changed, 180 insertions(+), 142 deletions(-) diff --git a/simgui.json b/simgui.json index 1cea73e1..62d7f9c7 100644 --- a/simgui.json +++ b/simgui.json @@ -185,11 +185,6 @@ "/SmartDashboard/winch_motor/mechanism": "Mechanism2d" }, "windows": { - "/FMSInfo": { - "window": { - "visible": true - } - }, "/SmartDashboard/Climb/mechanism": { "window": { "visible": true @@ -916,11 +911,6 @@ "visible": true } }, - "/SmartDashboard/Rebuilt/Auto Modes": { - "window": { - "visible": true - } - }, "/SmartDashboard/Robot Visual": { "window": { "visible": true @@ -936,6 +926,26 @@ "window": { "visible": true } + }, + "/SmartDashboard/hoodmotor/mechanism": { + "window": { + "visible": true + } + }, + "/SmartDashboard/lowershootermotor/mechanism": { + "window": { + "visible": true + } + }, + "/SmartDashboard/turretmotor/mechanism": { + "window": { + "visible": true + } + }, + "/SmartDashboard/uppershootermotor/mechanism": { + "window": { + "visible": true + } } } }, @@ -1063,9 +1073,6 @@ } } }, - "NetworkTables Info": { - "visible": true - }, "NetworkTables View": { "visible": false } diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index b11ec91f..d5aeb5ba 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -9,6 +9,7 @@ import frc.robot.rebuilt.commands.AutoCommands; import frc.robot.rebuilt.commands.ClimbCommands; import frc.robot.rebuilt.commands.IntakeCommands; +import frc.robot.rebuilt.commands.LauncherCommands; import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; @@ -28,6 +29,7 @@ public class Rebuilt extends GenericRobot { Climb climb; Intake intake; Launcher launcher; + LauncherCommands launcherCommands; AutoCommands autocommands; ClimbCommands climbCommands; IntakeCommands intakecommands; @@ -42,13 +44,14 @@ public Rebuilt(String directory) { drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); testCommands = new TestCommands(subsystems); climbCommands = new ClimbCommands(subsystems); + launcherCommands = new LauncherCommands(subsystems); // intakecommands = new IntakeCommands(subsystems); } @Override public void configureButtonBindings(Controller driver, Controller operator) { - testCommands.configureButtonBindings(driver); - climbCommands.configureButtonBindings(operator); + climbCommands.configureButtonBindings(driver); + launcherCommands.configureButtonBindings(driver); } @Override @@ -60,6 +63,7 @@ public void configureAltButtonBindings(Controller driver, Controller operator) { @Override public void setupDefaultCommands(Controller driver, Controller operator) { drivetrain.setDefaultCommand(drivetrain.createDefaultCommand(driver)); + launcherCommands.setDefaultCommands(); } @Override diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index e1ca0d26..be496f84 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -47,8 +47,8 @@ public ClimbCommands(Map subsystems) { public void configureButtonBindings(Controller controller) { // create Trigger objects for clarity and reuse - Trigger rightBumper = controller.createRightBumper(); - Trigger leftBumper = controller.createLeftBumper(); + Trigger rightBumper = controller.createXButton(); + Trigger leftBumper = controller.createYButton(); // idle -> elevate on right bumper press idleState.switchTo(elevateState).when(rightBumper); diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index f5d768ae..c5aca1c7 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,6 +1,5 @@ package frc.robot.rebuilt.commands; -import edu.wpi.first.units.Units; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.Trigger; @@ -11,11 +10,15 @@ import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; import org.frc5010.common.sensors.Controller; +import org.frc5010.common.telemetry.DisplayString; +import org.frc5010.common.telemetry.DisplayValuesHelper; import yams.mechanisms.positional.Arm; public class LauncherCommands { private StateMachine stateMachine; + private DisplayString commandState; + private DisplayValuesHelper DisplayHelper; private State lowState; private State prepState; private State readyState; @@ -26,20 +29,25 @@ public class LauncherCommands { public LauncherCommands(Map subsystems) { this.subsystems = subsystems; - + DisplayHelper = new DisplayValuesHelper("LauncherCommands"); + commandState = DisplayHelper.makeDisplayString("Launcher State"); launcher = (Launcher) subsystems.get(Constants.LAUNCHER); stateMachine = new StateMachine("LauncherStateMachine"); - lowState = stateMachine.addState("LOW-SPEED", Commands.idle()); + lowState = stateMachine.addState("LOW-SPEED", lowStateCommand()); + prepState = stateMachine.addState("PREP-SHOOT", prepStateCommand()); + readyState = stateMachine.addState("READY-TO-SHOOT", readyStateCommand()); + stateMachine.setInitialState(lowState); } - public void configureButtonBindings(Controller controller) { - + public void setDefaultCommands() { if (launcher != null) { + stateMachine.addRequirements(launcher); launcher.setDefaultCommand(stateMachine); } + } - controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); + public void configureButtonBindings(Controller controller) { Trigger rightBumper = controller.createRightBumper(); Trigger leftBumper = controller.createLeftBumper(); @@ -50,111 +58,29 @@ public void configureButtonBindings(Controller controller) { prepState.switchTo(readyState).when(leftBumper); readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); - if (lowState != null && lowState.isScheduled()) { + // if (lowState != null && lowState.isScheduled()) { - launcher.setHoodAngle(Units.Degrees.of(0)); - launcher.setLowerSpeed(0.5); - launcher.setTurretRotation(Units.Degrees.of(0)); - } + // launcher.setHoodAngle(Units.Degrees.of(0)); + // launcher.setLowerSpeed(0.5); + // launcher.setTurretRotation(Units.Degrees.of(0)); + // } + } + + private Command lowStateCommand() { + return Commands.parallel( + Commands.print("Launcher in LOW-SPEED state"), + Commands.runOnce(() -> commandState.setValue("Low Speed"))); + } + + private Command prepStateCommand() { + return Commands.parallel( + Commands.print("Launcher in PREP state"), + Commands.runOnce(() -> commandState.setValue("Prep"))); } - public Command testLauncherCommand(double speed, double time) { - - return (Commands.run( - () -> { - launcher.runShooter(speed); - }) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.runShooter(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setUpperSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setUpperSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setHoodAngle(Units.Degrees.of(90)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setHoodAngle(Units.Degrees.of(180)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setHoodAngle(Units.Degrees.of(-90)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setHoodAngle(Units.Degrees.of(-180)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setHoodAngle(Units.Degrees.of(0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setTurretRotation(Units.Degrees.of(90.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setTurretRotation(Units.Degrees.of(180.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setTurretRotation(Units.Degrees.of(-90.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setTurretRotation(Units.Degrees.of(180.0)); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setTurretRotation(Units.Degrees.of(0)); - })) - .withTimeout(time)) - .repeatedly(); + private Command readyStateCommand() { + return Commands.parallel( + Commands.print("Launcher in READY state"), + Commands.runOnce(() -> commandState.setValue("Ready"))); } } diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 84eaf14c..efea46be 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -1,5 +1,8 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.units.Units; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; @@ -31,5 +34,107 @@ public void configureButtonBindings(Controller controller) { indexer.ConfigController(controller); intake.ConfigController(controller); climb.ConfigController(controller); + controller.createLeftStickButton().whileTrue(testLauncherCommand(4, 1)); + } + + public Command testLauncherCommand(double speed, double time) { + + return (Commands.run( + () -> { + launcher.runShooter(speed); + }, + launcher) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.runShooter(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setUpperSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setUpperSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setLowerSpeed(speed); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setLowerSpeed(0); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(-90)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(-180)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setHoodAngle(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(-90.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(180.0)); + })) + .withTimeout(time)) + .andThen( + (Commands.run( + () -> { + launcher.setTurretRotation(Units.Degrees.of(0)); + })) + .withTimeout(time)) + .repeatedly(); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 73a15ee5..432bef4d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -6,21 +6,19 @@ import static edu.wpi.first.units.Units.Meters; -import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.sensors.Controller; -import org.littletonrobotics.junction.Logger; - import edu.wpi.first.units.measure.Distance; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.subsystems.Climb.ClimbIOReal; -import frc.robot.rebuilt.subsystems.Climb.ClimbIOSim; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.Logger; import yams.mechanisms.positional.Elevator; public class Climb extends GenericSubsystem { /** Creates a new Climb. */ private static Elevator climber; + private final ClimbIO io; private final ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); @@ -41,21 +39,19 @@ public void ConfigController(Controller controller) { public Climb() { super("climb.json"); - if (RobotBase.isSimulation()) { - io = new ClimbIOSim(devices); - } else { - io = new ClimbIOReal(devices); + if (RobotBase.isSimulation()) { + io = new ClimbIOSim(devices); + } else { + io = new ClimbIOReal(devices); climber = (Elevator) devices.get("Climb"); + } } -} - public void setHeight(double height) { Distance mydist = Meters.of(height); climber.getMotorController().setPosition(mydist); } - - + @Override public void periodic() { super.periodic(); diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java index 242a4c96..904ccd15 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java @@ -43,8 +43,8 @@ public void RunFeeder(double speed) { } public void ConfigController(Controller controller) { - controller.createXButton().whileTrue(spindexerCommand(.25)); - controller.createYButton().whileTrue(feederCommand(.25)); + controller.createAButton().whileTrue(spindexerCommand(.25)); + controller.createBButton().whileTrue(feederCommand(.25)); } public Command feederCommand(double speed) { From 79865569579f10d67b21ff924afc5282ef273dcf Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 24 Jan 2026 14:46:47 -0500 Subject: [PATCH 053/371] Intake Simulation and Io --- simgui-ds.json | 3 +- src/main/java/frc/robot/BuildConstants.java | 12 ++++---- .../java/frc/robot/rebuilt/Constants.java | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../rebuilt/commands/IntakeCommands.java | 14 +++++++-- .../rebuilt/commands/LauncherCommands.java | 12 ++++---- .../robot/rebuilt/commands/TestCommands.java | 2 +- .../subsystems/{ => intake}/Intake.java | 29 ++++++++++++++++++- .../rebuilt/subsystems/intake/IntakeIO.java | 10 +++++++ .../subsystems/intake/IntakeIOReal.java | 14 +++++++++ .../subsystems/intake/IntakeIOSim.java | 26 +++++++++++++++++ 11 files changed, 104 insertions(+), 22 deletions(-) rename src/main/java/frc/robot/rebuilt/subsystems/{ => intake}/Intake.java (56%) create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java diff --git a/simgui-ds.json b/simgui-ds.json index 4abf5597..01e79d2a 100644 --- a/simgui-ds.json +++ b/simgui-ds.json @@ -97,8 +97,7 @@ ], "robotJoysticks": [ { - "guid": "78696e70757401000000000000000000", - "useGamepad": true + "guid": "Keyboard0" } ] } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 536bca37..50641dfe 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "Rebuilt2026"; + public static final String MAVEN_NAME = "Rebuilt2026-1"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 156; - public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; - public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; + public static final int GIT_REVISION = 160; + public static final String GIT_SHA = "66c83704644465b623f6fdfa523fbfcc59fd2cd2"; + public static final String GIT_DATE = "2026-01-24 11:21:30 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-23 18:26:53 EST"; - public static final long BUILD_UNIX_TIME = 1769210813704L; + public static final String BUILD_DATE = "2026-01-24 14:27:07 EST"; + public static final long BUILD_UNIX_TIME = 1769282827056L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index 79269d56..5af9d1d5 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -2,8 +2,8 @@ import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; public class Constants { public static final String INDEXER = Indexer.class.getSimpleName(); diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 4b8ce010..6a365940 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -12,8 +12,8 @@ import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.constants.SwerveConstants; diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index 3934e7fe..d9f12f39 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -3,7 +3,7 @@ import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; +import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; @@ -22,6 +22,14 @@ public IntakeCommands(Map subsystems) { State retracting = intakeStateMachine.addState( - "retracting", Commands.print("RETRACTING").andThen(intake.spintakeCommand(0))); - State intaking = intakeStateMachine.addState("intaking", Commands.print("INTAKING").andThen()); + "retracting", + Commands.print("RETRACTING") + .andThen(() -> intake.RunSpintake(0)) + .andThen(() -> intake.setHeight(100))); + State intaking = + intakeStateMachine.addState( + "intaking", + Commands.print("INTAKING") + .andThen(() -> intake.RunSpintake(25)) + .andThen(() -> intake.setHeight(0))); } diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index b80b573e..4c84807d 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,18 +1,16 @@ package frc.robot.rebuilt.commands; -import java.util.Map; - -import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.arch.StateMachine; -import org.frc5010.common.arch.StateMachine.State; -import org.frc5010.common.sensors.Controller; - import edu.wpi.first.units.Units; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Launcher; +import java.util.Map; +import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.sensors.Controller; import yams.mechanisms.positional.Arm; public class LauncherCommands { diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index affe312f..84f7b8ac 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -3,8 +3,8 @@ import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java similarity index 56% rename from src/main/java/frc/robot/rebuilt/subsystems/Intake.java rename to src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java index 250fd44b..6bd9827e 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java @@ -2,21 +2,36 @@ // 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. -package frc.robot.rebuilt.subsystems; +package frc.robot.rebuilt.subsystems.intake; +import static edu.wpi.first.units.Units.Meters; + +import edu.wpi.first.units.measure.Distance; +import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.Logger; +import yams.mechanisms.positional.Elevator; public class Intake extends GenericSubsystem { private PercentControlMotor Spintake; + private Elevator Winch; + private IntakeIO io; + private IntakeIOInputsAutoLogged inputs = new IntakeIOInputsAutoLogged(); /** Creates a new Intake. */ public Intake() { super("intake.json"); Spintake = (PercentControlMotor) devices.get("spintake"); + Winch = (Elevator) devices.get("winch"); + if (RobotBase.isSimulation()) { + io = new IntakeIOSim(devices); + } else { + io = new IntakeIOReal(devices); + } } public void RunSpintake(double speed) { @@ -37,4 +52,16 @@ public Command spintakeCommand(double speed) { RunSpintake(0); }); } + + public void setHeight(double height) { + Distance mydist = Meters.of(height); + Winch.getMotorController().setPosition(mydist); + } + + @Override + public void periodic() { + super.periodic(); + io.updateInputs(inputs); + Logger.processInputs("Intake", inputs); + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java new file mode 100644 index 00000000..38c248d7 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java @@ -0,0 +1,10 @@ +package frc.robot.rebuilt.subsystems.intake; + +import org.littletonrobotics.junction.AutoLog; + +public interface IntakeIO { + @AutoLog + public static class IntakeIOInputs {} + + public default void updateInputs(IntakeIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java new file mode 100644 index 00000000..6b71107c --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java @@ -0,0 +1,14 @@ +package frc.robot.rebuilt.subsystems.intake; + +import java.util.Map; + +public class IntakeIOReal implements IntakeIO { + protected Map devices; + + public IntakeIOReal(Map devices) { + this.devices = devices; + } + + @Override + public void updateInputs(IntakeIOInputs inputs) {} +} diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java new file mode 100644 index 00000000..61ccac2e --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java @@ -0,0 +1,26 @@ +package frc.robot.rebuilt.subsystems.intake; + +import static edu.wpi.first.units.Units.Meters; + +import java.util.Map; +import org.frc5010.common.drive.GenericDrivetrain; +import swervelib.simulation.ironmaple.simulation.IntakeSimulation; +import swervelib.simulation.ironmaple.simulation.drivesims.AbstractDriveTrainSimulation; + +public class IntakeIOSim extends IntakeIOReal { + private IntakeSimulation intakeSimulation; + private AbstractDriveTrainSimulation driveTrainSimulation; + + public IntakeIOSim(Map devices) { + super(devices); + driveTrainSimulation = GenericDrivetrain.getMapleSimDrive().get(); + this.intakeSimulation = + IntakeSimulation.OverTheBumperIntake( + "Gamepiece", + driveTrainSimulation, + Meters.of(0.7), + Meters.of(0.2), + IntakeSimulation.IntakeSide.BACK, + 1); + } +} From 748f5570b8692d4c9abc99d0279653c6517c3401 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 24 Jan 2026 14:56:16 -0500 Subject: [PATCH 054/371] Started adding positioning for the launcher --- .../rebuilt/commands/LauncherCommands.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index c5aca1c7..2cc80906 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,17 +1,22 @@ package frc.robot.rebuilt.commands; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.Trigger; -import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; + import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.config.ConfigConstants; +import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.sensors.Controller; import org.frc5010.common.telemetry.DisplayString; import org.frc5010.common.telemetry.DisplayValuesHelper; + +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; +import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; import yams.mechanisms.positional.Arm; public class LauncherCommands { @@ -24,7 +29,9 @@ public class LauncherCommands { private State readyState; private Arm hood; private Launcher launcher; + private GenericDrivetrain drivetrain; private Map subsystems; + private Translation2d target = new Translation2d(0,0); public LauncherCommands(Map subsystems) { @@ -33,6 +40,7 @@ public LauncherCommands(Map subsystems) { commandState = DisplayHelper.makeDisplayString("Launcher State"); launcher = (Launcher) subsystems.get(Constants.LAUNCHER); stateMachine = new StateMachine("LauncherStateMachine"); + drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); lowState = stateMachine.addState("LOW-SPEED", lowStateCommand()); prepState = stateMachine.addState("PREP-SHOOT", prepStateCommand()); @@ -66,6 +74,10 @@ public void configureButtonBindings(Controller controller) { // } } + private Translation2d getTargetPose(){ + return drivetrain.getPoseEstimator().getCurrentPose().getTranslation(); + } + private Command lowStateCommand() { return Commands.parallel( Commands.print("Launcher in LOW-SPEED state"), From b313a93a3231f36d1ae4cf6bd46d774ef5b34341 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 24 Jan 2026 14:58:12 -0500 Subject: [PATCH 055/371] Update Intake imports --- src/main/java/frc/robot/rebuilt/Constants.java | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- src/main/java/frc/robot/rebuilt/commands/TestCommands.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index f44a5bf4..67a3d94b 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -2,8 +2,8 @@ import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; public class Constants { public static final String INDEXER = Indexer.class.getSimpleName(); diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index d5aeb5ba..64c839e2 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -13,8 +13,8 @@ import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.constants.SwerveConstants; diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index efea46be..7d9158e9 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -6,8 +6,8 @@ import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Intake; import frc.robot.rebuilt.subsystems.Launcher.Launcher; +import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; From 70903e9e82faaf680018bbcbf3ec9e3675a29178 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 24 Jan 2026 15:52:02 -0500 Subject: [PATCH 056/371] Added Launcher Commands init test --- .../rebuilt/commands/LauncherCommands.java | 66 ++++++++++++++----- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index 2cc80906..15e78a56 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,29 +1,33 @@ package frc.robot.rebuilt.commands; -import java.util.Map; +import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.Inches; +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; +import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.subsystems.Launcher.Launcher; +import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.sensors.Controller; +import org.frc5010.common.telemetry.DisplayAngle; import org.frc5010.common.telemetry.DisplayString; import org.frc5010.common.telemetry.DisplayValuesHelper; - -import edu.wpi.first.math.geometry.Translation2d; -import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.Trigger; -import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Launcher.Launcher; import yams.mechanisms.positional.Arm; public class LauncherCommands { private StateMachine stateMachine; private DisplayString commandState; + private DisplayAngle turretAngle; private DisplayValuesHelper DisplayHelper; + private State idleState; private State lowState; private State prepState; private State readyState; @@ -31,17 +35,19 @@ public class LauncherCommands { private Launcher launcher; private GenericDrivetrain drivetrain; private Map subsystems; - private Translation2d target = new Translation2d(0,0); + private Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); public LauncherCommands(Map subsystems) { this.subsystems = subsystems; - DisplayHelper = new DisplayValuesHelper("LauncherCommands"); + DisplayHelper = new DisplayValuesHelper("LauncherCommands", "Values"); commandState = DisplayHelper.makeDisplayString("Launcher State"); + turretAngle = DisplayHelper.makeDisplayAngle("Turret Angle"); launcher = (Launcher) subsystems.get(Constants.LAUNCHER); stateMachine = new StateMachine("LauncherStateMachine"); drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); + idleState = stateMachine.addState("IDLE", idleStateCommand()); lowState = stateMachine.addState("LOW-SPEED", lowStateCommand()); prepState = stateMachine.addState("PREP-SHOOT", prepStateCommand()); readyState = stateMachine.addState("READY-TO-SHOOT", readyStateCommand()); @@ -74,25 +80,53 @@ public void configureButtonBindings(Controller controller) { // } } - private Translation2d getTargetPose(){ - return drivetrain.getPoseEstimator().getCurrentPose().getTranslation(); + private Translation2d getTargetPose() { + return target.minus(drivetrain.getPoseEstimator().getCurrentPose().getTranslation()); + } + + private Command idleStateCommand() { + return Commands.parallel( + Commands.runOnce(() -> commandState.setValue("Idle")), + Commands.runOnce( + () -> { + turretAngle.setAngle(Degrees.of(0)); + launcher.setTurretRotation(turretAngle.getAngle()); + launcher.setHoodAngle(Degrees.of(0)); + })); } private Command lowStateCommand() { return Commands.parallel( - Commands.print("Launcher in LOW-SPEED state"), - Commands.runOnce(() -> commandState.setValue("Low Speed"))); + Commands.runOnce(() -> commandState.setValue("Low Speed")), + Commands.run( + () -> { + Translation2d targetPose = getTargetPose(); + turretAngle.setAngle(targetPose.getAngle().getMeasure()); + launcher.setTurretRotation(targetPose.getAngle().getMeasure()); + })); } private Command prepStateCommand() { return Commands.parallel( Commands.print("Launcher in PREP state"), - Commands.runOnce(() -> commandState.setValue("Prep"))); + Commands.runOnce(() -> commandState.setValue("Prep")), + Commands.run( + () -> { + Translation2d targetPose = getTargetPose(); + turretAngle.setAngle(targetPose.getAngle().getMeasure()); + launcher.setTurretRotation(targetPose.getAngle().getMeasure()); + })); } private Command readyStateCommand() { return Commands.parallel( Commands.print("Launcher in READY state"), - Commands.runOnce(() -> commandState.setValue("Ready"))); + Commands.runOnce(() -> commandState.setValue("Ready")), + Commands.run( + () -> { + Translation2d targetPose = getTargetPose(); + turretAngle.setAngle(targetPose.getAngle().getMeasure()); + launcher.setTurretRotation(targetPose.getAngle().getMeasure()); + })); } } From 344f3b974deca94f4b3e0dc68e497d509c8699dc Mon Sep 17 00:00:00 2001 From: Curt Date: Sun, 25 Jan 2026 09:18:20 -0500 Subject: [PATCH 057/371] Refactor and enhance Launcher subsystem and commands Refactored the Launcher subsystem to use IO abstraction, added detailed input tracking, and implemented new commands for target tracking and stopping. Introduced tolerance constants in Constants.java, updated LauncherIO and its implementations for real and simulated hardware, and simplified LauncherCommands to use new tracking commands. Also updated simgui-ds.json for joystick configuration and made IntakeIOSim's simulation static for cross-class access. --- simgui-ds.json | 4 +- .../java/frc/robot/rebuilt/Constants.java | 7 ++ .../rebuilt/commands/LauncherCommands.java | 41 ++----- .../rebuilt/subsystems/Launcher/Launcher.java | 105 +++++++++++++----- .../subsystems/Launcher/LauncherIO.java | 42 ++++++- .../subsystems/Launcher/LauncherIOReal.java | 82 +++++++++++++- .../subsystems/Launcher/LauncherIOSim.java | 16 +++ .../subsystems/intake/IntakeIOSim.java | 4 +- 8 files changed, 235 insertions(+), 66 deletions(-) diff --git a/simgui-ds.json b/simgui-ds.json index 01e79d2a..56cfde4a 100644 --- a/simgui-ds.json +++ b/simgui-ds.json @@ -97,7 +97,9 @@ ], "robotJoysticks": [ { - "guid": "Keyboard0" + "guid": "78696e70757401000000000000000000", + "name": "Driver", + "useGamepad": true } ] } diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index 67a3d94b..a6a1e50f 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -10,4 +10,11 @@ public class Constants { public static final String CLIMB = Climb.class.getSimpleName(); public static final String INTAKE = Intake.class.getSimpleName(); public static final String LAUNCHER = Launcher.class.getSimpleName(); + + public static class LauncherConstants { + public static final double UPPER_SHOOTER_TOLERANCE_RPM = 50.0; + public static final double LOWER_SHOOTER_TOLERANCE_RPM = 50.0; + public static final double HOOD_ANGLE_TOLERANCE_DEGREES = 1.0; + public static final double TURRET_ANGLE_TOLERANCE_DEGREES = 1.0; + } } diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index 15e78a56..b4f514b9 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -1,6 +1,5 @@ package frc.robot.rebuilt.commands; -import static edu.wpi.first.units.Units.Degrees; import static edu.wpi.first.units.Units.Inches; import edu.wpi.first.math.geometry.Translation2d; @@ -16,37 +15,32 @@ import org.frc5010.common.config.ConfigConstants; import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.sensors.Controller; -import org.frc5010.common.telemetry.DisplayAngle; import org.frc5010.common.telemetry.DisplayString; import org.frc5010.common.telemetry.DisplayValuesHelper; -import yams.mechanisms.positional.Arm; public class LauncherCommands { private StateMachine stateMachine; private DisplayString commandState; - private DisplayAngle turretAngle; private DisplayValuesHelper DisplayHelper; private State idleState; private State lowState; private State prepState; private State readyState; - private Arm hood; private Launcher launcher; private GenericDrivetrain drivetrain; private Map subsystems; private Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); public LauncherCommands(Map subsystems) { - this.subsystems = subsystems; DisplayHelper = new DisplayValuesHelper("LauncherCommands", "Values"); commandState = DisplayHelper.makeDisplayString("Launcher State"); - turretAngle = DisplayHelper.makeDisplayAngle("Turret Angle"); + launcher = (Launcher) subsystems.get(Constants.LAUNCHER); - stateMachine = new StateMachine("LauncherStateMachine"); - drivetrain = (GenericDrivetrain) subsystems.get(ConfigConstants.DRIVETRAIN); + drivetrain = (GenericDrivetrain) this.subsystems.get(ConfigConstants.DRIVETRAIN); + stateMachine = new StateMachine("LauncherStateMachine"); idleState = stateMachine.addState("IDLE", idleStateCommand()); lowState = stateMachine.addState("LOW-SPEED", lowStateCommand()); prepState = stateMachine.addState("PREP-SHOOT", prepStateCommand()); @@ -86,47 +80,26 @@ private Translation2d getTargetPose() { private Command idleStateCommand() { return Commands.parallel( - Commands.runOnce(() -> commandState.setValue("Idle")), - Commands.runOnce( - () -> { - turretAngle.setAngle(Degrees.of(0)); - launcher.setTurretRotation(turretAngle.getAngle()); - launcher.setHoodAngle(Degrees.of(0)); - })); + Commands.runOnce(() -> commandState.setValue("Idle")), launcher.stopTrackingCommand()); } private Command lowStateCommand() { return Commands.parallel( Commands.runOnce(() -> commandState.setValue("Low Speed")), - Commands.run( - () -> { - Translation2d targetPose = getTargetPose(); - turretAngle.setAngle(targetPose.getAngle().getMeasure()); - launcher.setTurretRotation(targetPose.getAngle().getMeasure()); - })); + launcher.trackTargetCommand(() -> getTargetPose())); } private Command prepStateCommand() { return Commands.parallel( Commands.print("Launcher in PREP state"), Commands.runOnce(() -> commandState.setValue("Prep")), - Commands.run( - () -> { - Translation2d targetPose = getTargetPose(); - turretAngle.setAngle(targetPose.getAngle().getMeasure()); - launcher.setTurretRotation(targetPose.getAngle().getMeasure()); - })); + launcher.trackTargetCommand(() -> getTargetPose())); } private Command readyStateCommand() { return Commands.parallel( Commands.print("Launcher in READY state"), Commands.runOnce(() -> commandState.setValue("Ready")), - Commands.run( - () -> { - Translation2d targetPose = getTargetPose(); - turretAngle.setAngle(targetPose.getAngle().getMeasure()); - launcher.setTurretRotation(targetPose.getAngle().getMeasure()); - })); + launcher.trackTargetCommand(() -> getTargetPose())); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index 302cba89..e85befca 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -4,30 +4,25 @@ package frc.robot.rebuilt.subsystems.Launcher; +import static edu.wpi.first.units.Units.Degrees; + +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; import edu.wpi.first.wpilibj.RobotBase; +import edu.wpi.first.wpilibj2.command.Command; +import edu.wpi.first.wpilibj2.command.Commands; +import java.util.function.Supplier; import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; -import yams.mechanisms.positional.Arm; -import yams.mechanisms.positional.Pivot; -import yams.mechanisms.velocity.FlyWheel; public class Launcher extends GenericSubsystem { private final LauncherIO io; private final LauncherIOInputsAutoLogged inputs = new LauncherIOInputsAutoLogged(); - private Pivot Turret; - private Arm Hood; - private FlyWheel UpperShooter; - private FlyWheel LowerShooter; /** Creates a new Launcher. */ public Launcher() { super("launcher.json"); - Turret = (Pivot) devices.get("turretmotor"); - Hood = (Arm) devices.get("hoodmotor"); - UpperShooter = (FlyWheel) devices.get("uppershootermotor"); - LowerShooter = (FlyWheel) devices.get("lowershootermotor"); + if (RobotBase.isSimulation()) { io = new LauncherIOSim(devices); } else { @@ -35,38 +30,94 @@ public Launcher() { } } + /** + * Updates the inputs of the Launcher subsystem from the physical devices. + * + *

This method is called periodically by the GenericSubsystem class. + */ + @Override + public void periodic() { + super.periodic(); + io.updateInputs(inputs); + Logger.processInputs("Launcher", inputs); + } + + /** + * Called every time the scheduler runs while the robot is in simulation mode. Used to update + * simulation models. + */ + @Override + public void simulationPeriodic() { + super.simulationPeriodic(); + io.updateSimulation(); + } + + /** + * Run the shooter at the given speed. This is a convenience method which simply calls + * setUpperSpeed with the given speed. + * + * @param speed the speed to set the upper shooter motor to, in units of RPM. + */ public void runShooter(double speed) { - UpperShooter.getMotor().setDutyCycle(speed); - LowerShooter.getMotor().setDutyCycle(speed); + io.setUpperSpeed(speed); } public void setUpperSpeed(double speed) { - UpperShooter.getMotor().setDutyCycle(speed); + io.setUpperSpeed(speed); } public void setLowerSpeed(double speed) { - LowerShooter.getMotor().setDutyCycle(speed); + io.setLowerSpeed(speed); } public void setHoodAngle(Angle angle) { - Hood.getMotorController().setPosition(angle); + io.setHoodAngle(angle); } public void setTurretRotation(Angle angle) { - Turret.getMotorController().setPosition(angle); + io.setTurretRotation(angle); } - public void ConfigController(Controller controller) {} + /** + * A command which tracks a target using the turret rotation and hood angle. The command will + * continuously set the turret rotation and hood angle to the angle of the target relative to the + * robot. + * + * @param targetSupplier a supplier which returns the target pose to track. + * @return a command which tracks the target with the turret rotation and hood angle. + */ + public Command trackTargetCommand(Supplier targetSupplier) { + return Commands.run( + () -> { + Translation2d targetPose = targetSupplier.get(); + setTurretRotation(targetPose.getAngle().getMeasure()); + }); + } - @Override - public void periodic() { - super.periodic(); - io.updateInputs(inputs); - Logger.processInputs("Launcher", inputs); + /** + * A command which stops the tracking of a target and resets the turret rotation and hood angle to + * 0 degrees. + * + * @return a command which stops tracking and resets the turret rotation and hood angle. + */ + public Command stopTrackingCommand() { + return Commands.runOnce( + () -> { + setTurretRotation(Degrees.of(0)); + setHoodAngle(Degrees.of(0)); + }); } - @Override - public void simulationPeriodic() { - super.simulationPeriodic(); + /** + * Checks if the robot is at the desired speed and angle. This method returns true if the robot + * speed and angle are within the allowed tolerances of the desired values. + * + * @return true if the robot is at the desired speed and angle, false otherwise. + */ + public boolean atGoal() { + return inputs.upperSpeedAtGoal + && inputs.lowerSpeedAtGoal + && inputs.hoodAngleAtGoal + && inputs.turretAngleAtGoal; } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java index 50f5171c..852a08ad 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java @@ -1,12 +1,52 @@ package frc.robot.rebuilt.subsystems.Launcher; +import static edu.wpi.first.units.Units.Degrees; + +import edu.wpi.first.units.measure.Angle; import org.littletonrobotics.junction.AutoLog; /** IO interface for the Launcher subsystem. */ public interface LauncherIO { @AutoLog - public static class LauncherIOInputs {} + public static class LauncherIOInputs { + public double upperSpeedDesired = 0.0; + public double lowerSpeedDesired = 0.0; + public Angle hoodAngleDesired = Degrees.of(0.0); + public Angle turretAngleDesired = Degrees.of(0.0); + + public double upperSpeedActual = 0.0; + public double lowerSpeedActual = 0.0; + public Angle hoodAngleActual = Degrees.of(0.0); + public Angle turretAngleActual = Degrees.of(0.0); + + public boolean upperSpeedAtGoal = false; + public boolean lowerSpeedAtGoal = false; + public boolean hoodAngleAtGoal = false; + public boolean turretAngleAtGoal = false; + + public double upperSpeedError = 0.0; + public double lowerSpeedError = 0.0; + public double hoodAngleError = 0.0; + public double turretAngleError = 0.0; + + public double hoodVelocity = 0.0; + public double turretVelocity = 0.0; + public double upperMotorOutput = 0.0; + public double lowerMotorOutput = 0.0; + } public default void updateInputs(LauncherIOInputs inputs) {} + + public void runShooter(double speed); + + public void setUpperSpeed(double speed); + + public void setLowerSpeed(double speed); + + public void setHoodAngle(Angle angle); + + public void setTurretRotation(Angle angle); + + public default void updateSimulation() {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index 680ea460..5b9fb004 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -4,17 +4,97 @@ package frc.robot.rebuilt.subsystems.Launcher; +import static edu.wpi.first.units.Units.Amps; +import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.RPM; +import static edu.wpi.first.units.Units.Second; + +import edu.wpi.first.units.measure.Angle; +import frc.robot.rebuilt.Constants; import java.util.Map; +import yams.mechanisms.positional.Arm; +import yams.mechanisms.positional.Pivot; +import yams.mechanisms.velocity.FlyWheel; /** Add your docs here. */ public class LauncherIOReal implements LauncherIO { protected Map devices; + private Pivot Turret; + private Arm Hood; + private FlyWheel UpperShooter; + private FlyWheel LowerShooter; public LauncherIOReal(Map devices) { this.devices = devices; + Turret = (Pivot) devices.get("turretmotor"); + Hood = (Arm) devices.get("hoodmotor"); + UpperShooter = (FlyWheel) devices.get("uppershootermotor"); + LowerShooter = (FlyWheel) devices.get("lowershootermotor"); } @Override - public void updateInputs(LauncherIOInputs inputs) {} + public void updateInputs(LauncherIOInputs inputs) { + inputs.upperSpeedDesired = + UpperShooter.getMotorController() + .getMechanismSetpointVelocity() + .map(it -> it.in(RPM)) + .orElse(0.0); + inputs.lowerSpeedDesired = + LowerShooter.getMotorController() + .getMechanismSetpointVelocity() + .map(it -> it.in(RPM)) + .orElse(0.0); + inputs.hoodAngleDesired = + Hood.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); + inputs.turretAngleDesired = + Turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); + + inputs.upperSpeedActual = UpperShooter.getSpeed().in(RPM); + inputs.lowerSpeedActual = LowerShooter.getSpeed().in(RPM); + inputs.hoodAngleActual = Hood.getAngle(); + inputs.turretAngleActual = Turret.getAngle(); + + inputs.upperSpeedError = inputs.upperSpeedActual - inputs.upperSpeedDesired; + inputs.lowerSpeedError = inputs.lowerSpeedActual - inputs.lowerSpeedDesired; + inputs.hoodAngleError = inputs.hoodAngleActual.minus(inputs.hoodAngleDesired).in(Degrees); + inputs.turretAngleError = inputs.turretAngleActual.minus(inputs.turretAngleDesired).in(Degrees); + + inputs.upperSpeedAtGoal = + Math.abs(inputs.upperSpeedError) <= Constants.LauncherConstants.UPPER_SHOOTER_TOLERANCE_RPM; + inputs.lowerSpeedAtGoal = + Math.abs(inputs.lowerSpeedError) <= Constants.LauncherConstants.LOWER_SHOOTER_TOLERANCE_RPM; + inputs.hoodAngleAtGoal = + Math.abs(inputs.hoodAngleError) <= Constants.LauncherConstants.HOOD_ANGLE_TOLERANCE_DEGREES; + inputs.turretAngleAtGoal = + Math.abs(inputs.turretAngleError) + <= Constants.LauncherConstants.TURRET_ANGLE_TOLERANCE_DEGREES; + + inputs.hoodVelocity = Hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); + inputs.turretVelocity = + Turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); + inputs.upperMotorOutput = UpperShooter.getMotor().getStatorCurrent().in(Amps); + inputs.lowerMotorOutput = LowerShooter.getMotor().getStatorCurrent().in(Amps); + } + + public void runShooter(double speed) { + UpperShooter.getMotor().setDutyCycle(speed); + LowerShooter.getMotor().setDutyCycle(speed); + } + + public void setUpperSpeed(double speed) { + UpperShooter.getMotor().setDutyCycle(speed); + } + + public void setLowerSpeed(double speed) { + LowerShooter.getMotor().setDutyCycle(speed); + } + + public void setHoodAngle(Angle angle) { + Hood.getMotorController().setPosition(angle); + } + + public void setTurretRotation(Angle angle) { + Turret.getMotorController().setPosition(angle); + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java index bab342b9..e588e22e 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOSim.java @@ -4,6 +4,7 @@ package frc.robot.rebuilt.subsystems.Launcher; +import frc.robot.rebuilt.subsystems.intake.IntakeIOSim; import java.util.Map; /** Add your docs here. */ @@ -14,4 +15,19 @@ public class LauncherIOSim extends LauncherIOReal { public LauncherIOSim(Map devices) { super(devices); } + + @Override + public void updateSimulation() { + int amount = IntakeIOSim.intakeSimulation.getGamePiecesAmount(); + // Update simulated mechanism states here + // We should simulate a shot rate of about 10-15 gamepieces per second + // Every other time this is called, determine a randome number and if > 0.5, shoot a gamepiece. + // This would mean we try to shoot 25 times per second, and on average shoot about 12-13 + // gamepieces per second. + if (Math.random() > 0.5 && amount > 0) { + if (IntakeIOSim.intakeSimulation.obtainGamePieceFromIntake()) { + // Create a new gamepiece on-the-fly and add it to the field simulation + } + } + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java index 61ccac2e..0282f7e6 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java @@ -8,13 +8,13 @@ import swervelib.simulation.ironmaple.simulation.drivesims.AbstractDriveTrainSimulation; public class IntakeIOSim extends IntakeIOReal { - private IntakeSimulation intakeSimulation; + public static IntakeSimulation intakeSimulation; private AbstractDriveTrainSimulation driveTrainSimulation; public IntakeIOSim(Map devices) { super(devices); driveTrainSimulation = GenericDrivetrain.getMapleSimDrive().get(); - this.intakeSimulation = + intakeSimulation = IntakeSimulation.OverTheBumperIntake( "Gamepiece", driveTrainSimulation, From c45401a66c1b69d5c554ae98661963ad4bb7520c Mon Sep 17 00:00:00 2001 From: Curt Date: Mon, 26 Jan 2026 13:22:35 -0500 Subject: [PATCH 058/371] Add simSystemId configs to subsystem JSON files Added simSystemId parameters for feedback, feedforward, max velocity, and acceleration to climb_motor, winch, hood, shooter_lower, shooter_upper, and turret JSON files. Updated control modes for climb_motor and winch to CLOSED_LOOP. Also updated BuildConstants.java with new build metadata. --- .../subsystems/climb/climb_motor.json | 24 ++++++++++++++++++- .../subsystems/intake/winch.json | 24 ++++++++++++++++++- .../subsystems/launcher/hood.json | 20 ++++++++++++++++ .../subsystems/launcher/shooter_lower.json | 22 ++++++++++++++++- .../subsystems/launcher/shooter_upper.json | 22 ++++++++++++++++- .../subsystems/launcher/turret.json | 20 ++++++++++++++++ src/main/java/frc/robot/BuildConstants.java | 12 +++++----- 7 files changed, 134 insertions(+), 10 deletions(-) diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json index f47af100..8fba588e 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json @@ -25,7 +25,29 @@ "val": 20, "uom": "m/s^2" }, - "controlMode": "OPEN_LOOP" + "controlMode": "CLOSED_LOOP" + }, + "simSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "CLOSED_LOOP" }, "sprocketTeeth": 22, "lowerSoftLimit": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json index 55a1ddb7..7a074ee5 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json @@ -25,7 +25,29 @@ "val": 20, "uom": "m/s^2" }, - "controlMode": "OPEN_LOOP" + "controlMode": "CLOSED_LOOP" + }, + "simSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "CLOSED_LOOP" }, "sprocketTeeth": 22, "lowerSoftLimit": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index f936b512..9c71b2d5 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -25,6 +25,26 @@ "uom": "deg/s^2" } }, + "simSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, "length": { "val": 0.135, "uom": "in" diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json index 0b7ce46b..b629f88c 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json @@ -25,6 +25,26 @@ "uom": "deg/s^2" } }, + "simSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, "lowerSoftLimit": { "val": 0, "uom": "rpm" @@ -41,7 +61,7 @@ "val": 2, "uom": "kg" }, - "diameter": { + "radius": { "val": 0.05, "uom": "m" } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json index 1d752ed7..87d6ac12 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json @@ -25,6 +25,26 @@ "uom": "deg/s^2" } }, + "simSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, "lowerSoftLimit": { "val": 0, "uom": "rpm" @@ -41,7 +61,7 @@ "val": 2, "uom": "kg" }, - "diameter": { + "radius": { "val": 0.05, "uom": "m" } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index e0a21e93..2eebceb4 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -25,6 +25,26 @@ "uom": "deg/s^2" } }, + "simSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, "lowerHardLimit": { "val": -100, "uom": "deg" diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 87b04bac..5069b8cc 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "rebuilt2026"; + public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 156; - public static final String GIT_SHA = "3ee34e96f5705c6df0568b4216ce9ddf22d3dec9"; - public static final String GIT_DATE = "2026-01-23 18:00:06 EST"; + public static final int GIT_REVISION = 178; + public static final String GIT_SHA = "6adfb4d95fd4491eb02e5cbad2429d7dea6061a2"; + public static final String GIT_DATE = "2026-01-26 13:16:35 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-24 14:07:28 EST"; - public static final long BUILD_UNIX_TIME = 1769281648863L; + public static final String BUILD_DATE = "2026-01-26 13:20:52 EST"; + public static final long BUILD_UNIX_TIME = 1769451652832L; public static final int DIRTY = 1; private BuildConstants() {} From b68c5dbe82a0feeb0e3a780e2e4d6048489e3852 Mon Sep 17 00:00:00 2001 From: Curt Date: Mon, 26 Jan 2026 16:55:56 -0500 Subject: [PATCH 059/371] Update camera configs and motor positions for rebuilt robot Replaced 'intake' and 'localization' cameras with new 'left' and 'right' camera configs using PhotonVision, and updated cameras.json accordingly. Added detailed 'robotToMotor' position data to climb, intake winch, launcher hood, and shooter motors. Adjusted position values for indexer feeder, spindexer, and intake spintake subsystems to reflect updated measurements. --- src/main/deploy/rebuilt_robot/cameras.json | 3 +- .../deploy/rebuilt_robot/cameras/intake.json | 13 ------ .../deploy/rebuilt_robot/cameras/left.json | 12 +++++ .../rebuilt_robot/cameras/localization.json | 13 ------ .../deploy/rebuilt_robot/cameras/right.json | 12 +++++ src/main/deploy/rebuilt_robot/robot.json | 2 +- .../subsystems/climb/climb_motor.json | 38 +++++++++++---- .../subsystems/indexer/feeder.json | 6 +-- .../subsystems/indexer/spindexer.json | 6 +-- .../subsystems/intake/spintake.json | 6 +-- .../subsystems/intake/winch.json | 38 +++++++++++---- .../subsystems/launcher/hood.json | 36 +++++++++++---- .../subsystems/launcher/shooter_lower.json | 20 +++++++- .../subsystems/launcher/shooter_upper.json | 46 ++++++++++--------- src/main/java/frc/robot/BuildConstants.java | 10 ++-- 15 files changed, 167 insertions(+), 94 deletions(-) delete mode 100644 src/main/deploy/rebuilt_robot/cameras/intake.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/left.json delete mode 100644 src/main/deploy/rebuilt_robot/cameras/localization.json create mode 100644 src/main/deploy/rebuilt_robot/cameras/right.json diff --git a/src/main/deploy/rebuilt_robot/cameras.json b/src/main/deploy/rebuilt_robot/cameras.json index 49999d11..815aa88c 100644 --- a/src/main/deploy/rebuilt_robot/cameras.json +++ b/src/main/deploy/rebuilt_robot/cameras.json @@ -1,5 +1,6 @@ { "cameras": [ - "localization.json" + "left.json", + "right.json" ] } diff --git a/src/main/deploy/rebuilt_robot/cameras/intake.json b/src/main/deploy/rebuilt_robot/cameras/intake.json deleted file mode 100644 index 33938add..00000000 --- a/src/main/deploy/rebuilt_robot/cameras/intake.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "intake", - "use": "target", - "type": "limelight", - "column": 0, - "x": 0.15, - "y": 0.05, - "z": 0.2, - "roll": 0, - "pitch": 10, - "yaw": 0, - "targetHeight": 0.02 -} diff --git a/src/main/deploy/rebuilt_robot/cameras/left.json b/src/main/deploy/rebuilt_robot/cameras/left.json new file mode 100644 index 00000000..435871d5 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/left.json @@ -0,0 +1,12 @@ +{ + "name": "left", + "use": "apriltag", + "type": "photonvision", + "column": 0, + "x": -0.33, + "y": 0.33, + "z": 0.5, + "roll": 0, + "pitch": 0, + "yaw": 180 +} diff --git a/src/main/deploy/rebuilt_robot/cameras/localization.json b/src/main/deploy/rebuilt_robot/cameras/localization.json deleted file mode 100644 index 706b561a..00000000 --- a/src/main/deploy/rebuilt_robot/cameras/localization.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "localization", - "use": "apriltag", - "type": "limelight", - "strategy": "LOWEST_AMBIGUITY", - "column": 0, - "x": -0.35, - "y": -0.25, - "z": 0.5, - "roll": 0, - "pitch": -20, - "yaw": 180 -} diff --git a/src/main/deploy/rebuilt_robot/cameras/right.json b/src/main/deploy/rebuilt_robot/cameras/right.json new file mode 100644 index 00000000..d2271d22 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/cameras/right.json @@ -0,0 +1,12 @@ +{ + "name": "right", + "use": "apriltag", + "type": "photonvision", + "column": 0, + "x": -0.33, + "y": -0.33, + "z": 0.5, + "roll": 0, + "pitch": 0, + "yaw": 180 +} diff --git a/src/main/deploy/rebuilt_robot/robot.json b/src/main/deploy/rebuilt_robot/robot.json index 0a20f3e5..769c7e38 100644 --- a/src/main/deploy/rebuilt_robot/robot.json +++ b/src/main/deploy/rebuilt_robot/robot.json @@ -1,7 +1,7 @@ { "userConfig": "competition_mode.json", "driveType": "AKIT_SWERVE_DRIVE", - "trackWidth": 16.8, + "trackWidth": 2, "trackWidthUom": "in", "wheelBase": 18.5, "wheelBaseUom": "in", diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json index 8fba588e..d472ddb8 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json @@ -3,7 +3,25 @@ "name": "Climb", "controllerType": "spark", "motorType": "Neo", - "canId": 16 + "canId": 16, + "robotToMotor": { + "x": { + "val": -10.7, + "uom": "in" + }, + "y": { + "val": -3.669, + "uom": "in" + }, + "z": { + "val": 5.323, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } }, "motorSystemId": { "feedBack": { @@ -51,31 +69,31 @@ }, "sprocketTeeth": 22, "lowerSoftLimit": { - "val": 0.1, + "val": 0, "uom": "m" }, "upperSoftLimit": { - "val": 2, - "uom": "m" + "val": 20, + "uom": "in" }, "lowerHardLimit": { - "val": 0.1, - "uom": "m" + "val": 0, + "uom": "in" }, "upperHardLimit": { - "val": 3, - "uom": "m" + "val": 25, + "uom": "in" }, "gearing": [ 3, 4 ], "startingPosition": { - "val": 0.5, + "val": 0, "uom": "m" }, "mass": { - "val": 16, + "val": 5, "uom": "lbs" } } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json index 39f9e825..c531b07c 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json @@ -4,7 +4,7 @@ "type": "Neo", "id": 9, "gearing": 1.0, - "x": -0.40, - "y": 0.0, - "z": 0.10 + "x": -0.236, + "y": -0.001, + "z": 0.136 } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json index 3ae85b0b..b03ec06d 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json @@ -5,7 +5,7 @@ "id": 10, "gearing": 1.0, "momentOfInertiaKgMSq": 1.0, - "x": -0.05, - "y": 0.0, - "z": 0.1 + "x": 0.5, + "y": -0.092, + "z": 0.2 } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json index c214de94..a687ee27 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json @@ -5,7 +5,7 @@ "id": 11, "gearing": 1.0, "momentOfInertiaKgMSq": 1.0, - "x": 0.5, - "y": 0.0, - "z": 0.25 + "x": 0.6, + "y": -0.33, + "z": 0.143 } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json index 7a074ee5..f92fc4ae 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json @@ -3,7 +3,25 @@ "name": "winch_motor", "controllerType": "spark", "motorType": "Neo", - "canId": 12 + "canId": 12, + "robotToMotor": { + "x": { + "val": 8.36, + "uom": "in" + }, + "y": { + "val": 13.482, + "uom": "in" + }, + "z": { + "val": 8.394, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } }, "motorSystemId": { "feedBack": { @@ -51,31 +69,31 @@ }, "sprocketTeeth": 22, "lowerSoftLimit": { - "val": 0.1, + "val": 0, "uom": "m" }, "upperSoftLimit": { - "val": 2, - "uom": "m" + "val": 12, + "uom": "in" }, "lowerHardLimit": { - "val": 0.1, - "uom": "m" + "val": 0, + "uom": "in" }, "upperHardLimit": { - "val": 3, - "uom": "m" + "val": 12, + "uom": "in" }, "gearing": [ 3, 4 ], "startingPosition": { - "val": 0.5, + "val": 0, "uom": "m" }, "mass": { - "val": 16, + "val": 1, "uom": "lbs" } } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index 9c71b2d5..812e7f90 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -3,7 +3,25 @@ "name": "hoodmotor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 13 + "canId": 13, + "robotToMotor": { + "x": { + "val": -8.2, + "uom": "in" + }, + "y": { + "val": 10.104, + "uom": "in" + }, + "z": { + "val": 15.786, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } }, "motorSystemId": { "feedBack": { @@ -46,27 +64,27 @@ } }, "length": { - "val": 0.135, - "uom": "in" + "val": 0.234, + "uom": "m" }, "lowerHardLimit": { - "val": -80, + "val": 55, "uom": "deg" }, "upperHardLimit": { - "val": 200, + "val": 100, "uom": "deg" }, "startingAngle": { - "val": 0, + "val": 55, "uom": "deg" }, "lowerSoftLimit": { - "val": -30, + "val": 55, "uom": "deg" }, "upperSoftLimit": { - "val": 100, + "val": 85, "uom": "deg" }, "gearing": [ @@ -78,7 +96,7 @@ "uom": "lbs" }, "horizontalZero": { - "val": 0, + "val": 55, "uom": "deg" } } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json index b629f88c..095b6460 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json @@ -3,7 +3,25 @@ "name": "lowershootermotor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 14 + "canId": 14, + "robotToMotor": { + "x": { + "val": -5.872, + "uom": "in" + }, + "y": { + "val": 4.8, + "uom": "in" + }, + "z": { + "val": 14.466, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } }, "motorSystemId": { "feedBack": { diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json index 87d6ac12..f531ba43 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json @@ -3,7 +3,25 @@ "name": "uppershootermotor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 15 + "canId": 15, + "robotToMotor": { + "x": { + "val": -5.872, + "uom": "in" + }, + "y": { + "val": 4.8, + "uom": "in" + }, + "z": { + "val": 14.466, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } }, "motorSystemId": { "feedBack": { @@ -15,14 +33,6 @@ "s": 0.0, "v": 0.0, "a": 0.0 - }, - "maxVelocity": { - "val": 180, - "uom": "deg/s" - }, - "maxAcceleration": { - "val": 90, - "uom": "deg/s^2" } }, "simSystemId": { @@ -35,18 +45,10 @@ "s": 0.0, "v": 0.0, "a": 0.0 - }, - "maxVelocity": { - "val": 180, - "uom": "deg/s" - }, - "maxAcceleration": { - "val": 90, - "uom": "deg/s^2" } }, "lowerSoftLimit": { - "val": 0, + "val": -5000, "uom": "rpm" }, "upperSoftLimit": { @@ -58,11 +60,11 @@ 4 ], "mass": { - "val": 2, - "uom": "kg" + "val": 5, + "uom": "lbs" }, "radius": { - "val": 0.05, - "uom": "m" + "val": 1.925, + "uom": "in" } } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 5069b8cc..82389369 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 178; - public static final String GIT_SHA = "6adfb4d95fd4491eb02e5cbad2429d7dea6061a2"; - public static final String GIT_DATE = "2026-01-26 13:16:35 EST"; + public static final int GIT_REVISION = 179; + public static final String GIT_SHA = "c45401a66c1b69d5c554ae98661963ad4bb7520c"; + public static final String GIT_DATE = "2026-01-26 13:22:35 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-26 13:20:52 EST"; - public static final long BUILD_UNIX_TIME = 1769451652832L; + public static final String BUILD_DATE = "2026-01-26 16:46:43 EST"; + public static final long BUILD_UNIX_TIME = 1769464003236L; public static final int DIRTY = 1; private BuildConstants() {} From 8e103f8e78a846c5519c60b67b251f2126ba555a Mon Sep 17 00:00:00 2001 From: Curt Date: Mon, 26 Jan 2026 17:08:06 -0500 Subject: [PATCH 060/371] Update climb motor and turret limit values Adjusted soft and hard limit values for climb motor and turret subsystems in their respective JSON configs. These changes refine the operational range and units for improved accuracy and safety. --- .../rebuilt_robot/subsystems/climb/climb_motor.json | 6 +++--- .../deploy/rebuilt_robot/subsystems/launcher/turret.json | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json index d472ddb8..2efc17ef 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json @@ -70,10 +70,10 @@ "sprocketTeeth": 22, "lowerSoftLimit": { "val": 0, - "uom": "m" + "uom": "in" }, "upperSoftLimit": { - "val": 20, + "val": 9, "uom": "in" }, "lowerHardLimit": { @@ -81,7 +81,7 @@ "uom": "in" }, "upperHardLimit": { - "val": 25, + "val": 26.5, "uom": "in" }, "gearing": [ diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index 2eebceb4..36fbf8b1 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -46,11 +46,11 @@ } }, "lowerHardLimit": { - "val": -100, + "val": -170, "uom": "deg" }, "upperHardLimit": { - "val": 200, + "val": 170, "uom": "deg" }, "startingAngle": { @@ -58,11 +58,11 @@ "uom": "deg" }, "lowerSoftLimit": { - "val": -30, + "val": -170, "uom": "deg" }, "upperSoftLimit": { - "val": 100, + "val": 170, "uom": "deg" }, "gearing": [ From d1b676bd1c352d168e4ddec48b7a45a7a307ad1a Mon Sep 17 00:00:00 2001 From: Curt Date: Mon, 26 Jan 2026 17:16:29 -0500 Subject: [PATCH 061/371] Add turret position --- .../subsystems/launcher/turret.json | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index 36fbf8b1..72d8102f 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -3,7 +3,26 @@ "name": "turretmotor", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 16 + "canId": 16, + "robotToMotor": { + "x": { + "val": -5.872, + "uom": "in" + }, + "y": { + "val": 4.8, + "uom": "in" + }, + "z": { + "val": 14.466, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + }, + "movementPlane": "XY" }, "motorSystemId": { "feedBack": { From cc4c5bec117168df462fa868daf65cd88a28ade6 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Fri, 30 Jan 2026 16:55:21 -0500 Subject: [PATCH 062/371] Moved IndexerIO stuff into the right folder --- src/main/java/frc/robot/rebuilt/Constants.java | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../java/frc/robot/rebuilt/commands/IntakeCommands.java | 2 +- src/main/java/frc/robot/rebuilt/commands/TestCommands.java | 2 +- .../frc/robot/rebuilt/subsystems/{ => Indexer}/Indexer.java | 6 ++---- .../rebuilt/{commands => subsystems/Indexer}/IndexerIO.java | 2 +- .../{commands => subsystems/Indexer}/IndexerIOReal.java | 4 +++- .../{commands => subsystems/Indexer}/IndexerIOSim.java | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) rename src/main/java/frc/robot/rebuilt/subsystems/{ => Indexer}/Indexer.java (92%) rename src/main/java/frc/robot/rebuilt/{commands => subsystems/Indexer}/IndexerIO.java (81%) rename src/main/java/frc/robot/rebuilt/{commands => subsystems/Indexer}/IndexerIOReal.java (69%) rename src/main/java/frc/robot/rebuilt/{commands => subsystems/Indexer}/IndexerIOSim.java (80%) diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index a6a1e50f..0547b284 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -1,7 +1,7 @@ package frc.robot.rebuilt; import frc.robot.rebuilt.subsystems.Climb.Climb; -import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.Launcher.Launcher; import frc.robot.rebuilt.subsystems.intake.Intake; diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 64c839e2..e5ea9478 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -12,7 +12,7 @@ import frc.robot.rebuilt.commands.LauncherCommands; import frc.robot.rebuilt.commands.TestCommands; import frc.robot.rebuilt.subsystems.Climb.Climb; -import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.Launcher.Launcher; import frc.robot.rebuilt.subsystems.intake.Intake; import org.frc5010.common.arch.GenericRobot; diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index d9f12f39..7400ed9b 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -2,7 +2,7 @@ import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 7d9158e9..223979c0 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -5,7 +5,7 @@ import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Climb.Climb; -import frc.robot.rebuilt.subsystems.Indexer; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.Launcher.Launcher; import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java similarity index 92% rename from src/main/java/frc/robot/rebuilt/subsystems/Indexer.java rename to src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index 904ccd15..f78cda1a 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -2,15 +2,13 @@ // 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. -package frc.robot.rebuilt.subsystems; +package frc.robot.rebuilt.subsystems.Indexer; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.IndexerIO; import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; -import frc.robot.rebuilt.commands.IndexerIOReal; -import frc.robot.rebuilt.commands.IndexerIOSim; + import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java similarity index 81% rename from src/main/java/frc/robot/rebuilt/commands/IndexerIO.java rename to src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java index d595f8fb..471e37a3 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java @@ -1,4 +1,4 @@ -package frc.robot.rebuilt.commands; +package frc.robot.rebuilt.subsystems.Indexer; import org.littletonrobotics.junction.AutoLog; diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java similarity index 69% rename from src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java rename to src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index 9bb2bf2e..e7bb101e 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -1,7 +1,9 @@ -package frc.robot.rebuilt.commands; +package frc.robot.rebuilt.subsystems.Indexer; import java.util.Map; +import frc.robot.rebuilt.subsystems.Indexer.IndexerIO.IndexerIOInputs; + public class IndexerIOReal implements IndexerIO { protected Map devices; diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOSim.java similarity index 80% rename from src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java rename to src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOSim.java index d6452130..4e744926 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOSim.java @@ -1,4 +1,4 @@ -package frc.robot.rebuilt.commands; +package frc.robot.rebuilt.subsystems.Indexer; import java.util.Map; From 2be0a7557fd5814dd25f9671ab084116b3a90281 Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Fri, 30 Jan 2026 18:34:06 -0500 Subject: [PATCH 063/371] Add IndexerCommands and clean up Indexer imports Added a new (empty) IndexerCommands.java file. Removed an unused import in Indexer.java and IndexerIOReal.java for code cleanliness. Updated BuildConstants with latest build and git information. --- src/main/java/frc/robot/BuildConstants.java | 10 +++++----- .../frc/robot/rebuilt/commands/IndexerCommands.java | 0 .../frc/robot/rebuilt/subsystems/Indexer/Indexer.java | 1 - .../rebuilt/subsystems/Indexer/IndexerIOReal.java | 2 -- 4 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 82389369..0f6c0dc7 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 179; - public static final String GIT_SHA = "c45401a66c1b69d5c554ae98661963ad4bb7520c"; - public static final String GIT_DATE = "2026-01-26 13:22:35 EST"; + public static final int GIT_REVISION = 183; + public static final String GIT_SHA = "cc4c5bec117168df462fa868daf65cd88a28ade6"; + public static final String GIT_DATE = "2026-01-30 16:55:21 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-26 16:46:43 EST"; - public static final long BUILD_UNIX_TIME = 1769464003236L; + public static final String BUILD_DATE = "2026-01-30 17:39:14 EST"; + public static final long BUILD_UNIX_TIME = 1769812754609L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java new file mode 100644 index 00000000..e69de29b diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index f78cda1a..382174a2 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -8,7 +8,6 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; - import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index e7bb101e..e1df90c1 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -2,8 +2,6 @@ import java.util.Map; -import frc.robot.rebuilt.subsystems.Indexer.IndexerIO.IndexerIOInputs; - public class IndexerIOReal implements IndexerIO { protected Map devices; From 3af4a127b886d4f5c8c8468a8d12f311f069e68a Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Fri, 30 Jan 2026 18:45:54 -0500 Subject: [PATCH 064/371] Updated intake winch to be a pinion (elevator) --- .../rebuilt_robot/subsystems/intake.json | 2 +- .../subsystems/intake/pinion.json | 99 +++++++++++++++++++ src/main/java/frc/robot/BuildConstants.java | 10 +- .../rebuilt/commands/IntakeCommands.java | 4 +- .../rebuilt/subsystems/Indexer/Indexer.java | 2 - .../rebuilt/subsystems/Indexer/IndexerIO.java | 1 - .../subsystems/Indexer/IndexerIOReal.java | 3 +- .../rebuilt/subsystems/intake/Intake.java | 16 +-- 8 files changed, 116 insertions(+), 21 deletions(-) create mode 100644 src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index b9f6ab6f..75f641da 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -6,7 +6,7 @@ }, { "device": "yams_elevator", - "file": "intake/winch.json" + "file": "intake/pinion.json" } ], "display": true diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json b/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json new file mode 100644 index 00000000..9fc3d2cd --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json @@ -0,0 +1,99 @@ +{ + "motorSetup": { + "name": "pinion_motor", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 12, + "robotToMotor": { + "x": { + "val": -10.7, + "uom": "in" + }, + "y": { + "val": -3.669, + "uom": "in" + }, + "z": { + "val": 5.323, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } + }, + "motorSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "CLOSED_LOOP" + }, + "simSystemId": { + "feedBack": { + "p": 2.7739E-10, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.013799, + "g": 0.24168, + "v": 10.219, + "a": 0.2153 + }, + "maxVelocity": { + "val": 4, + "uom": "m/s" + }, + "maxAcceleration": { + "val": 20, + "uom": "m/s^2" + }, + "controlMode": "CLOSED_LOOP" + }, + "sprocketTeeth": 22, + "lowerSoftLimit": { + "val": 0, + "uom": "in" + }, + "upperSoftLimit": { + "val": 9, + "uom": "in" + }, + "lowerHardLimit": { + "val": 0, + "uom": "in" + }, + "upperHardLimit": { + "val": 26.5, + "uom": "in" + }, + "gearing": [ + 3, + 4 + ], + "startingPosition": { + "val": 0, + "uom": "m" + }, + "mass": { + "val": 5, + "uom": "lbs" + } +} diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 82389369..dfb18902 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 179; - public static final String GIT_SHA = "c45401a66c1b69d5c554ae98661963ad4bb7520c"; - public static final String GIT_DATE = "2026-01-26 13:22:35 EST"; + public static final int GIT_REVISION = 183; + public static final String GIT_SHA = "cc4c5bec117168df462fa868daf65cd88a28ade6"; + public static final String GIT_DATE = "2026-01-30 16:55:21 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-26 16:46:43 EST"; - public static final long BUILD_UNIX_TIME = 1769464003236L; + public static final String BUILD_DATE = "2026-01-30 18:44:18 EST"; + public static final long BUILD_UNIX_TIME = 1769816658128L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index 7400ed9b..e8f2335f 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -25,11 +25,11 @@ public IntakeCommands(Map subsystems) { "retracting", Commands.print("RETRACTING") .andThen(() -> intake.RunSpintake(0)) - .andThen(() -> intake.setHeight(100))); + .andThen(() -> intake.setPinionPosition(100))); State intaking = intakeStateMachine.addState( "intaking", Commands.print("INTAKING") .andThen(() -> intake.RunSpintake(25)) - .andThen(() -> intake.setHeight(0))); + .andThen(() -> intake.setPinionPosition(0))); } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index f78cda1a..00a74d55 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -7,8 +7,6 @@ import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; - import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java index 471e37a3..094f6861 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java @@ -7,5 +7,4 @@ public interface IndexerIO { public static class IndexerIOInputs {} public default void updateInputs(IndexerIOInputs inputs) {} - ; } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index e7bb101e..8d67d2ff 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -1,8 +1,7 @@ package frc.robot.rebuilt.subsystems.Indexer; -import java.util.Map; - import frc.robot.rebuilt.subsystems.Indexer.IndexerIO.IndexerIOInputs; +import java.util.Map; public class IndexerIOReal implements IndexerIO { protected Map devices; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java index 6bd9827e..bf563eee 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java @@ -17,16 +17,16 @@ import yams.mechanisms.positional.Elevator; public class Intake extends GenericSubsystem { - private PercentControlMotor Spintake; - private Elevator Winch; + private PercentControlMotor spintake; + private Elevator intakePinion; private IntakeIO io; private IntakeIOInputsAutoLogged inputs = new IntakeIOInputsAutoLogged(); /** Creates a new Intake. */ public Intake() { super("intake.json"); - Spintake = (PercentControlMotor) devices.get("spintake"); - Winch = (Elevator) devices.get("winch"); + spintake = (PercentControlMotor) devices.get("spintake"); + intakePinion = (Elevator) devices.get("intakePinion"); if (RobotBase.isSimulation()) { io = new IntakeIOSim(devices); } else { @@ -35,7 +35,7 @@ public Intake() { } public void RunSpintake(double speed) { - Spintake.set(speed); + spintake.set(speed); } public void ConfigController(Controller controller) { @@ -53,9 +53,9 @@ public Command spintakeCommand(double speed) { }); } - public void setHeight(double height) { - Distance mydist = Meters.of(height); - Winch.getMotorController().setPosition(mydist); + public void setPinionPosition(double position) { + Distance mydist = Meters.of(position); + intakePinion.setHeight(mydist); } @Override From 920df38e4ae2e0dfbf8fd6cef5ee3d3ded9785ac Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Sat, 31 Jan 2026 13:00:30 -0500 Subject: [PATCH 065/371] Remove import from invalid location Remove import from invalid location --- src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index f78cda1a..00a74d55 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -7,8 +7,6 @@ import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; - import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; From b95b6f2f01731fbf79491a07ce5de95bb34df865 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 31 Jan 2026 13:07:20 -0500 Subject: [PATCH 066/371] Rearrange motors and IDs --- simgui.json | 34 +++---- .../rebuilt_robot/subsystems/climb.json | 5 +- .../climb/{climb_motor.json => lifter.json} | 8 +- .../rebuilt_robot/subsystems/indexer.json | 9 +- .../subsystems/indexer/feeder.json | 10 -- .../subsystems/indexer/spindexer.json | 6 +- .../subsystems/indexer/transfer_back.json | 10 ++ .../subsystems/indexer/transfer_front.json | 10 ++ .../rebuilt_robot/subsystems/intake.json | 5 +- .../subsystems/intake/pinion.json | 4 +- .../subsystems/intake/spintake.json | 99 +++++++++++++++++-- .../subsystems/intake/winch.json | 99 ------------------- .../rebuilt_robot/subsystems/launcher.json | 9 +- .../{shooter_lower.json => flywheel.json} | 10 +- .../subsystems/launcher/hood.json | 6 +- .../subsystems/launcher/shooter_upper.json | 70 ------------- .../subsystems/launcher/turret.json | 6 +- src/main/java/frc/robot/BuildConstants.java | 10 +- .../rebuilt/commands/IndexerCommands.java | 1 + .../robot/rebuilt/subsystems/Climb/Climb.java | 2 +- .../rebuilt/subsystems/Indexer/Indexer.java | 11 ++- .../subsystems/Launcher/LauncherIOReal.java | 31 +++--- .../rebuilt/subsystems/intake/Intake.java | 8 +- 23 files changed, 189 insertions(+), 274 deletions(-) rename src/main/deploy/rebuilt_robot/subsystems/climb/{climb_motor.json => lifter.json} (93%) delete mode 100644 src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json create mode 100644 src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_back.json create mode 100644 src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_front.json delete mode 100644 src/main/deploy/rebuilt_robot/subsystems/intake/winch.json rename src/main/deploy/rebuilt_robot/subsystems/launcher/{shooter_lower.json => flywheel.json} (90%) delete mode 100644 src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json diff --git a/simgui.json b/simgui.json index c7b0c22b..d22be11e 100644 --- a/simgui.json +++ b/simgui.json @@ -176,20 +176,21 @@ "/SmartDashboard/Turret/mechanism": "Mechanism2d", "/SmartDashboard/VisionSystemSim-Vision/Sim Field": "Field2d", "/SmartDashboard/VisionSystemSim-main/Sim Field": "Field2d", + "/SmartDashboard/flywheel/mechanism": "Mechanism2d", + "/SmartDashboard/hood/mechanism": "Mechanism2d", "/SmartDashboard/hoodmotor/mechanism": "Mechanism2d", + "/SmartDashboard/lifter/mechanism": "Mechanism2d", "/SmartDashboard/lowershootermotor/mechanism": "Mechanism2d", "/SmartDashboard/navX-Sensor[1]": "Gyro", "/SmartDashboard/navX-Sensor[4]": "Gyro", + "/SmartDashboard/pinion/mechanism": "Mechanism2d", + "/SmartDashboard/spintake/mechanism": "Mechanism2d", + "/SmartDashboard/turret/mechanism": "Mechanism2d", "/SmartDashboard/turretmotor/mechanism": "Mechanism2d", "/SmartDashboard/uppershootermotor/mechanism": "Mechanism2d", "/SmartDashboard/winch_motor/mechanism": "Mechanism2d" }, "windows": { - "/SmartDashboard/Climb/mechanism": { - "window": { - "visible": true - } - }, "/SmartDashboard/Drive Visual": { "window": { "visible": true @@ -876,11 +877,6 @@ "visible": true } }, - "/SmartDashboard/Elevator/mechanism": { - "window": { - "visible": true - } - }, "/SmartDashboard/Field": { "OdometryPose": { "arrowColor": [ @@ -906,10 +902,7 @@ "left": 245, "right": 3942, "top": 118, - "width": 16.54119300842285, - "window": { - "visible": true - } + "width": 16.54119300842285 }, "/SmartDashboard/Robot Visual": { "window": { @@ -927,22 +920,27 @@ "visible": true } }, - "/SmartDashboard/hoodmotor/mechanism": { + "/SmartDashboard/flywheel/mechanism": { + "window": { + "visible": true + } + }, + "/SmartDashboard/hood/mechanism": { "window": { "visible": true } }, - "/SmartDashboard/lowershootermotor/mechanism": { + "/SmartDashboard/pinion/mechanism": { "window": { "visible": true } }, - "/SmartDashboard/turretmotor/mechanism": { + "/SmartDashboard/spintake/mechanism": { "window": { "visible": true } }, - "/SmartDashboard/uppershootermotor/mechanism": { + "/SmartDashboard/turret/mechanism": { "window": { "visible": true } diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb.json b/src/main/deploy/rebuilt_robot/subsystems/climb.json index 84169478..3dda928d 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb.json @@ -2,8 +2,7 @@ "devices": [ { "device": "yams_elevator", - "file": "climb/climb_motor.json" + "file": "climb/lifter.json" } - ], - "display": true + ] } diff --git a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json b/src/main/deploy/rebuilt_robot/subsystems/climb/lifter.json similarity index 93% rename from src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json rename to src/main/deploy/rebuilt_robot/subsystems/climb/lifter.json index 2efc17ef..3cc152c8 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/climb/climb_motor.json +++ b/src/main/deploy/rebuilt_robot/subsystems/climb/lifter.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "Climb", - "controllerType": "spark", - "motorType": "Neo", - "canId": 16, + "name": "lifter", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 19, "robotToMotor": { "x": { "val": -10.7, diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer.json index d5d1a074..e2da8fd0 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer.json @@ -2,12 +2,15 @@ "devices": [ { "device": "percent_motor", - "file": "indexer/feeder.json" + "file": "indexer/transfer_front.json" + }, + { + "device": "percent_motor", + "file": "indexer/transfer_back.json" }, { "device": "percent_motor", "file": "indexer/spindexer.json" } - ], - "display": true + ] } diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json deleted file mode 100644 index c531b07c..00000000 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/feeder.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "feeder", - "controller": "spark", - "type": "Neo", - "id": 9, - "gearing": 1.0, - "x": -0.236, - "y": -0.001, - "z": 0.136 -} diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json index b03ec06d..bacd343e 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/spindexer.json @@ -1,8 +1,8 @@ { "name": "spindexer", - "controller": "spark", - "type": "Neo", - "id": 10, + "controller": "talonfx", + "type": "KrakenX44", + "id": 9, "gearing": 1.0, "momentOfInertiaKgMSq": 1.0, "x": 0.5, diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_back.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_back.json new file mode 100644 index 00000000..75775998 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_back.json @@ -0,0 +1,10 @@ +{ + "name": "transfer_back", + "controller": "talonfx", + "type": "KrakenX60", + "id": 11, + "gearing": 1.0, + "x": -0.236, + "y": -0.001, + "z": 0.136 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_front.json b/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_front.json new file mode 100644 index 00000000..c76c9866 --- /dev/null +++ b/src/main/deploy/rebuilt_robot/subsystems/indexer/transfer_front.json @@ -0,0 +1,10 @@ +{ + "name": "transfer_front", + "controller": "talonfx", + "type": "KrakenX60", + "id": 10, + "gearing": 1.0, + "x": -0.236, + "y": -0.001, + "z": 0.136 +} diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake.json b/src/main/deploy/rebuilt_robot/subsystems/intake.json index 75f641da..c925d97f 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake.json @@ -1,13 +1,12 @@ { "devices": [ { - "device": "percent_motor", + "device": "yams_shooter", "file": "intake/spintake.json" }, { "device": "yams_elevator", "file": "intake/pinion.json" } - ], - "display": true + ] } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json b/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json index 9fc3d2cd..8aa8d90f 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/pinion.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "pinion_motor", + "name": "pinion", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 12, + "canId": 14, "robotToMotor": { "x": { "val": -10.7, diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json index a687ee27..08e69f8d 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json +++ b/src/main/deploy/rebuilt_robot/subsystems/intake/spintake.json @@ -1,11 +1,92 @@ { - "name": "spintake", - "type": "Neo", - "controller": "spark", - "id": 11, - "gearing": 1.0, - "momentOfInertiaKgMSq": 1.0, - "x": 0.6, - "y": -0.33, - "z": 0.143 + "motorSetup": { + "name": "spintake", + "controllerType": "talonfx", + "motorType": "KrakenX60", + "canId": 12, + "followers": [ + { + "canId": 13, + "inverted": true + } + ], + "robotToMotor": { + "x": { + "val": -5.872, + "uom": "in" + }, + "y": { + "val": 4.8, + "uom": "in" + }, + "z": { + "val": 14.466, + "uom": "in" + }, + "rotation": { + "val": 0.0, + "uom": "deg" + } + } + }, + "motorSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "simSystemId": { + "feedBack": { + "p": 4, + "i": 0.0, + "d": 0.0 + }, + "feedForward": { + "s": 0.0, + "v": 0.0, + "a": 0.0 + }, + "maxVelocity": { + "val": 180, + "uom": "deg/s" + }, + "maxAcceleration": { + "val": 90, + "uom": "deg/s^2" + } + }, + "lowerSoftLimit": { + "val": 0, + "uom": "rpm" + }, + "upperSoftLimit": { + "val": 5000, + "uom": "rpm" + }, + "gearing": [ + 3, + 4 + ], + "mass": { + "val": 2, + "uom": "kg" + }, + "radius": { + "val": 0.05, + "uom": "m" + } } diff --git a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json b/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json deleted file mode 100644 index f92fc4ae..00000000 --- a/src/main/deploy/rebuilt_robot/subsystems/intake/winch.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "motorSetup": { - "name": "winch_motor", - "controllerType": "spark", - "motorType": "Neo", - "canId": 12, - "robotToMotor": { - "x": { - "val": 8.36, - "uom": "in" - }, - "y": { - "val": 13.482, - "uom": "in" - }, - "z": { - "val": 8.394, - "uom": "in" - }, - "rotation": { - "val": 0.0, - "uom": "deg" - } - } - }, - "motorSystemId": { - "feedBack": { - "p": 2.7739E-10, - "i": 0.0, - "d": 0.0 - }, - "feedForward": { - "s": 0.013799, - "g": 0.24168, - "v": 10.219, - "a": 0.2153 - }, - "maxVelocity": { - "val": 4, - "uom": "m/s" - }, - "maxAcceleration": { - "val": 20, - "uom": "m/s^2" - }, - "controlMode": "CLOSED_LOOP" - }, - "simSystemId": { - "feedBack": { - "p": 2.7739E-10, - "i": 0.0, - "d": 0.0 - }, - "feedForward": { - "s": 0.013799, - "g": 0.24168, - "v": 10.219, - "a": 0.2153 - }, - "maxVelocity": { - "val": 4, - "uom": "m/s" - }, - "maxAcceleration": { - "val": 20, - "uom": "m/s^2" - }, - "controlMode": "CLOSED_LOOP" - }, - "sprocketTeeth": 22, - "lowerSoftLimit": { - "val": 0, - "uom": "m" - }, - "upperSoftLimit": { - "val": 12, - "uom": "in" - }, - "lowerHardLimit": { - "val": 0, - "uom": "in" - }, - "upperHardLimit": { - "val": 12, - "uom": "in" - }, - "gearing": [ - 3, - 4 - ], - "startingPosition": { - "val": 0, - "uom": "m" - }, - "mass": { - "val": 1, - "uom": "lbs" - } -} diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher.json b/src/main/deploy/rebuilt_robot/subsystems/launcher.json index 4e1d5fc7..da7dc648 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher.json @@ -6,16 +6,11 @@ }, { "device": "yams_shooter", - "file": "launcher/shooter_upper.json" - }, - { - "device": "yams_shooter", - "file": "launcher/shooter_lower.json" + "file": "launcher/flywheel.json" }, { "device": "yams_turret", "file": "launcher/turret.json" } - ], - "display": true + ] } diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/flywheel.json similarity index 90% rename from src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json rename to src/main/deploy/rebuilt_robot/subsystems/launcher/flywheel.json index 095b6460..0c1e5d10 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_lower.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/flywheel.json @@ -1,9 +1,15 @@ { "motorSetup": { - "name": "lowershootermotor", + "name": "flywheel", "controllerType": "talonfx", "motorType": "KrakenX60", - "canId": 14, + "canId": 15, + "followers": [ + { + "canId": 16, + "inverted": true + } + ], "robotToMotor": { "x": { "val": -5.872, diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json index 812e7f90..b364a64e 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/hood.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "hoodmotor", + "name": "hood", "controllerType": "talonfx", - "motorType": "KrakenX60", - "canId": 13, + "motorType": "KrakenX44", + "canId": 18, "robotToMotor": { "x": { "val": -8.2, diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json deleted file mode 100644 index f531ba43..00000000 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/shooter_upper.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "motorSetup": { - "name": "uppershootermotor", - "controllerType": "talonfx", - "motorType": "KrakenX60", - "canId": 15, - "robotToMotor": { - "x": { - "val": -5.872, - "uom": "in" - }, - "y": { - "val": 4.8, - "uom": "in" - }, - "z": { - "val": 14.466, - "uom": "in" - }, - "rotation": { - "val": 0.0, - "uom": "deg" - } - } - }, - "motorSystemId": { - "feedBack": { - "p": 4, - "i": 0.0, - "d": 0.0 - }, - "feedForward": { - "s": 0.0, - "v": 0.0, - "a": 0.0 - } - }, - "simSystemId": { - "feedBack": { - "p": 4, - "i": 0.0, - "d": 0.0 - }, - "feedForward": { - "s": 0.0, - "v": 0.0, - "a": 0.0 - } - }, - "lowerSoftLimit": { - "val": -5000, - "uom": "rpm" - }, - "upperSoftLimit": { - "val": 5000, - "uom": "rpm" - }, - "gearing": [ - 3, - 4 - ], - "mass": { - "val": 5, - "uom": "lbs" - }, - "radius": { - "val": 1.925, - "uom": "in" - } -} diff --git a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json index 72d8102f..ea7bac05 100644 --- a/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json +++ b/src/main/deploy/rebuilt_robot/subsystems/launcher/turret.json @@ -1,9 +1,9 @@ { "motorSetup": { - "name": "turretmotor", + "name": "turret", "controllerType": "talonfx", - "motorType": "KrakenX60", - "canId": 16, + "motorType": "KrakenX44", + "canId": 17, "robotToMotor": { "x": { "val": -5.872, diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index dfb18902..df06338d 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 183; - public static final String GIT_SHA = "cc4c5bec117168df462fa868daf65cd88a28ade6"; - public static final String GIT_DATE = "2026-01-30 16:55:21 EST"; + public static final int GIT_REVISION = 186; + public static final String GIT_SHA = "7c03e920dab3be25349debc0cd8cbadaed906dbc"; + public static final String GIT_DATE = "2026-01-30 18:46:57 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-30 18:44:18 EST"; - public static final long BUILD_UNIX_TIME = 1769816658128L; + public static final String BUILD_DATE = "2026-01-31 13:03:37 EST"; + public static final long BUILD_UNIX_TIME = 1769882617883L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index e69de29b..8b137891 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -0,0 +1 @@ + diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 432bef4d..c68c8ef3 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -43,7 +43,7 @@ public Climb() { io = new ClimbIOSim(devices); } else { io = new ClimbIOReal(devices); - climber = (Elevator) devices.get("Climb"); + climber = (Elevator) devices.get("lifter"); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index f78cda1a..96d1b0b9 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -7,8 +7,7 @@ import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; - +// import frc.robot.rebuilt.commands.IndexerIOInputsAutoLogged; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; @@ -18,13 +17,15 @@ public class Indexer extends GenericSubsystem { private PercentControlMotor Spindexer; private final IndexerIO io; private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); - private PercentControlMotor Feeder; + private PercentControlMotor transferFront; + private PercentControlMotor transferBack; /** Creates a new Index. */ public Indexer() { super("indexer.json"); Spindexer = (PercentControlMotor) devices.get("spindexer"); - Feeder = (PercentControlMotor) devices.get("feeder"); + transferFront = (PercentControlMotor) devices.get("transfer_front"); + transferBack = (PercentControlMotor) devices.get("transfer_back"); if (RobotBase.isSimulation()) { io = new IndexerIOSim(devices); } else { @@ -37,7 +38,7 @@ public void RunSpindexer(double speed) { } public void RunFeeder(double speed) { - Feeder.set(speed); + transferFront.set(speed); } public void ConfigController(Controller controller) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index 5b9fb004..775f1fe0 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -22,26 +22,20 @@ public class LauncherIOReal implements LauncherIO { protected Map devices; private Pivot Turret; private Arm Hood; - private FlyWheel UpperShooter; - private FlyWheel LowerShooter; + private FlyWheel flyWheel; public LauncherIOReal(Map devices) { this.devices = devices; - Turret = (Pivot) devices.get("turretmotor"); - Hood = (Arm) devices.get("hoodmotor"); - UpperShooter = (FlyWheel) devices.get("uppershootermotor"); - LowerShooter = (FlyWheel) devices.get("lowershootermotor"); + Turret = (Pivot) devices.get("turret"); + Hood = (Arm) devices.get("hood"); + flyWheel = (FlyWheel) devices.get("flywheel"); } @Override public void updateInputs(LauncherIOInputs inputs) { inputs.upperSpeedDesired = - UpperShooter.getMotorController() - .getMechanismSetpointVelocity() - .map(it -> it.in(RPM)) - .orElse(0.0); - inputs.lowerSpeedDesired = - LowerShooter.getMotorController() + flyWheel + .getMotorController() .getMechanismSetpointVelocity() .map(it -> it.in(RPM)) .orElse(0.0); @@ -50,8 +44,7 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.turretAngleDesired = Turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); - inputs.upperSpeedActual = UpperShooter.getSpeed().in(RPM); - inputs.lowerSpeedActual = LowerShooter.getSpeed().in(RPM); + inputs.upperSpeedActual = flyWheel.getSpeed().in(RPM); inputs.hoodAngleActual = Hood.getAngle(); inputs.turretAngleActual = Turret.getAngle(); @@ -73,21 +66,19 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.hoodVelocity = Hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); inputs.turretVelocity = Turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); - inputs.upperMotorOutput = UpperShooter.getMotor().getStatorCurrent().in(Amps); - inputs.lowerMotorOutput = LowerShooter.getMotor().getStatorCurrent().in(Amps); + inputs.upperMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); } public void runShooter(double speed) { - UpperShooter.getMotor().setDutyCycle(speed); - LowerShooter.getMotor().setDutyCycle(speed); + flyWheel.getMotor().setDutyCycle(speed); } public void setUpperSpeed(double speed) { - UpperShooter.getMotor().setDutyCycle(speed); + flyWheel.getMotor().setDutyCycle(speed); } public void setLowerSpeed(double speed) { - LowerShooter.getMotor().setDutyCycle(speed); + flyWheel.getMotor().setDutyCycle(speed); } public void setHoodAngle(Angle angle) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java index bf563eee..1ff5285f 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java @@ -11,13 +11,13 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; import yams.mechanisms.positional.Elevator; +import yams.mechanisms.velocity.FlyWheel; public class Intake extends GenericSubsystem { - private PercentControlMotor spintake; + private FlyWheel spintake; private Elevator intakePinion; private IntakeIO io; private IntakeIOInputsAutoLogged inputs = new IntakeIOInputsAutoLogged(); @@ -25,8 +25,8 @@ public class Intake extends GenericSubsystem { /** Creates a new Intake. */ public Intake() { super("intake.json"); - spintake = (PercentControlMotor) devices.get("spintake"); - intakePinion = (Elevator) devices.get("intakePinion"); + spintake = (FlyWheel) devices.get("spintake"); + intakePinion = (Elevator) devices.get("pinion"); if (RobotBase.isSimulation()) { io = new IntakeIOSim(devices); } else { From afc3c3f35e57e670edb59f4a51cf3d62517edeca Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Sat, 31 Jan 2026 13:18:30 -0500 Subject: [PATCH 067/371] Add initial content setup to eliminate errors Add initial content setup to eliminate errors --- .../robot/rebuilt/commands/IndexerCommands.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index e69de29b..8744c297 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -0,0 +1,14 @@ +package frc.robot.rebuilt.commands; + +import java.util.Map; + +import org.frc5010.common.arch.GenericSubsystem; + +public class IndexerCommands { + private Map subsystems; + + public IndexerCommands(Map subsystems) { + this.subsystems = subsystems; + } + +} \ No newline at end of file From a7aefabcf97dd26ec0d650479ee9f32040aad4d8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 14:32:45 -0500 Subject: [PATCH 068/371] Add ClimbConstants and getHeight method to Climb Introduced ClimbConstants with a MAX distance constant in Constants.java and added a getHeight() method to the Climb subsystem to retrieve the current height. Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/rebuilt/Constants.java | 7 +++++++ .../java/frc/robot/rebuilt/subsystems/Climb/Climb.java | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index 0547b284..b5bff742 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -1,5 +1,8 @@ package frc.robot.rebuilt; +import static edu.wpi.first.units.Units.Inch; + +import edu.wpi.first.units.measure.Distance; import frc.robot.rebuilt.subsystems.Climb.Climb; import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.Launcher.Launcher; @@ -11,6 +14,10 @@ public class Constants { public static final String INTAKE = Intake.class.getSimpleName(); public static final String LAUNCHER = Launcher.class.getSimpleName(); + public static class ClimbConstants { + public static final Distance MAX = Inch.of(27); + } + public static class LauncherConstants { public static final double UPPER_SHOOTER_TOLERANCE_RPM = 50.0; public static final double LOWER_SHOOTER_TOLERANCE_RPM = 50.0; diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index c68c8ef3..112c3b82 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -52,6 +52,10 @@ public void setHeight(double height) { climber.getMotorController().setPosition(mydist); } + public Distance getHeight() { + return climber.getHeight(); + } + @Override public void periodic() { super.periodic(); From 7bc189cdb84492ef43028ec8450ad33542246c07 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 14:33:10 -0500 Subject: [PATCH 069/371] Refactor ClimbCommands state machine and button bindings Reworked ClimbCommands to use a more explicit ClimbState enum and improved state transitions for climbing logic. Added commands for elevating, stopping, and descending, and updated button bindings to use these commands. Also cleaned up IndexerCommands formatting. Updated BuildConstants with new build metadata. Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/BuildConstants.java | 12 +-- .../robot/rebuilt/commands/ClimbCommands.java | 80 ++++++++++++++----- .../rebuilt/commands/IndexerCommands.java | 2 - 3 files changed, 66 insertions(+), 28 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index df06338d..f2670e01 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "Rebuilt2026"; + public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 186; - public static final String GIT_SHA = "7c03e920dab3be25349debc0cd8cbadaed906dbc"; - public static final String GIT_DATE = "2026-01-30 18:46:57 EST"; + public static final int GIT_REVISION = 191; + public static final String GIT_SHA = "dc3ed96bdfbf255f962ea0aea89f78afb9b6186c"; + public static final String GIT_DATE = "2026-01-31 13:22:55 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-31 13:03:37 EST"; - public static final long BUILD_UNIX_TIME = 1769882617883L; + public static final String BUILD_DATE = "2026-01-31 14:23:24 EST"; + public static final long BUILD_UNIX_TIME = 1769887404744L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index be496f84..c64d866a 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -1,8 +1,12 @@ package frc.robot.rebuilt.commands; +import static edu.wpi.first.units.Units.Meters; + +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.Constants.ClimbConstants; import frc.robot.rebuilt.subsystems.Climb.Climb; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; @@ -16,28 +20,41 @@ public class ClimbCommands { private StateMachine stateMachine; private State idleState; private State elevateState; - private State lowerState; - private Boolean requestState; + private State descendState; + private State liftedState; + private State loweredState; + + private static enum ClimbState { + IDLE, + ELEVATE, + LIFTED, + DESCEND, + LOWERED + } + + Climb climb; + + private static ClimbState requestedState = ClimbState.LOWERED; public ClimbCommands(Map subsystems) { this.subsystems = subsystems; // Create a simple state machine for climb and set it as the default command for the Climb - Climb climb = (Climb) subsystems.get(Constants.CLIMB); + climb = (Climb) subsystems.get(Constants.CLIMB); stateMachine = new StateMachine("ClimbStateMachine"); // a simple idle state; transitions will be added in configureButtonBindings - idleState = stateMachine.addState("idle", Commands.idle()); + loweredState = stateMachine.addState("lowered", Commands.idle()); // states that actually run the climber if (climb != null) { elevateState = stateMachine.addState("elevate", climb.climberCommand(.5)); - lowerState = stateMachine.addState("lower", climb.climberCommand(0)); + descendState = stateMachine.addState("lower", climb.climberCommand(0)); } else { // fallback states if climb isn't available elevateState = stateMachine.addState("elevate", Commands.idle()); - lowerState = stateMachine.addState("lower", Commands.idle()); + descendState = stateMachine.addState("lower", Commands.idle()); } - stateMachine.setInitialState(idleState); + stateMachine.setInitialState(loweredState); if (climb != null) { stateMachine.addRequirements(climb); @@ -45,19 +62,42 @@ public ClimbCommands(Map subsystems) { } } - public void configureButtonBindings(Controller controller) { + public Command shouldElevateCommand() { + return Commands.runOnce(() -> requestedState = ClimbState.ELEVATE); + } + + public Command shouldStopCommand() { + return Commands.runOnce(() -> requestedState = ClimbState.IDLE); + } + + public Command shouldDescendCommand() { + return Commands.runOnce(() -> requestedState = ClimbState.DESCEND); + } + + public void configureButtonBindings(Controller operator) { + operator.createXButton().onTrue(shouldElevateCommand()).onFalse(shouldStopCommand()); + + operator.createYButton().onTrue(shouldDescendCommand()).onFalse(shouldStopCommand()); + // create Trigger objects for clarity and reuse - Trigger rightBumper = controller.createXButton(); - Trigger leftBumper = controller.createYButton(); - - // idle -> elevate on right bumper press - idleState.switchTo(elevateState).when(rightBumper); - // elevate -> idle when right bumper released - elevateState.switchTo(idleState).when(() -> !rightBumper.getAsBoolean()); - - // idle -> lower on left bumper press - idleState.switchTo(lowerState).when(leftBumper); - // lower -> idle when left bumper released - lowerState.switchTo(idleState).when(() -> !leftBumper.getAsBoolean()); + Trigger rightBumper = operator.createXButton(); + Trigger leftBumper = operator.createYButton(); + + // lowered -> elevate when requested + loweredState.switchTo(elevateState).when(() -> requestedState == ClimbState.ELEVATE); + // descend -> lowered when height is Zero + descendState.switchTo(loweredState).when(() -> climb.getHeight().isEquivalent(Meters.of(0))); + // elevate -> Lifted when height is =to Target + elevateState.switchTo(liftedState).when(() -> climb.getHeight().isEquivalent(ClimbConstants.MAX)); + // lifted -> descend when asked to descend + liftedState.switchTo(descendState).when(() -> requestedState == ClimbState.DESCEND); + // elevate -> descend when asked to descend + elevateState.switchTo(descendState).when(() -> requestedState == ClimbState.DESCEND); + // descend -> elevating when asked to elevate + descendState.switchTo(elevateState).when(() -> requestedState == ClimbState.ELEVATE); + // elevate -> idle when stopped + elevateState.switchTo(idleState).when(() -> requestedState == ClimbState.IDLE); + // descend -> idle when stopped + descendState.switchTo(idleState).when(() -> requestedState == ClimbState.IDLE); } } diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index 2fe6b13b..22e013e3 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -1,7 +1,6 @@ package frc.robot.rebuilt.commands; import java.util.Map; - import org.frc5010.common.arch.GenericSubsystem; public class IndexerCommands { @@ -10,5 +9,4 @@ public class IndexerCommands { public IndexerCommands(Map subsystems) { this.subsystems = subsystems; } - } From fae16a24242d3e806fb8ac4ae26deb82607b392b Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 14:47:34 -0500 Subject: [PATCH 070/371] Add idle command to Climb subsystem Introduces an idleCommand to the Climb subsystem, which sets the climber motor duty cycle to zero via a new idle() method in ClimbIO and its implementation in ClimbIOReal. Updates ClimbCommands to use the new idle state, improving clarity and control over the climber's idle behavior. Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- .../java/frc/robot/rebuilt/commands/ClimbCommands.java | 2 +- .../java/frc/robot/rebuilt/subsystems/Climb/Climb.java | 7 ++++++- .../java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java | 2 ++ .../frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java | 9 +++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index c64d866a..83a469fb 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -43,7 +43,7 @@ public ClimbCommands(Map subsystems) { climb = (Climb) subsystems.get(Constants.CLIMB); stateMachine = new StateMachine("ClimbStateMachine"); // a simple idle state; transitions will be added in configureButtonBindings - loweredState = stateMachine.addState("lowered", Commands.idle()); + idleState = stateMachine.addState("idle", climb.idleCommand()); // states that actually run the climber if (climb != null) { elevateState = stateMachine.addState("elevate", climb.climberCommand(.5)); diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 112c3b82..2195af90 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -32,6 +32,12 @@ public Command climberCommand(double height) { setHeight(0); }); } + + public Command idleCommand(){ + return Commands.runOnce(() -> { + io.idle(); + }, this); + } public void ConfigController(Controller controller) { controller.createBButton().whileTrue(climberCommand(.5)); @@ -43,7 +49,6 @@ public Climb() { io = new ClimbIOSim(devices); } else { io = new ClimbIOReal(devices); - climber = (Elevator) devices.get("lifter"); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java index 9e18d3ad..ba3e9312 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java @@ -8,5 +8,7 @@ public interface ClimbIO { @AutoLog public static class ClimbIOInputs {} + public void idle (); + public default void updateInputs(ClimbIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java index ee5575c8..85858444 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java @@ -6,13 +6,22 @@ import java.util.Map; +import yams.mechanisms.positional.Elevator; + /** Add your docs here. */ public class ClimbIOReal implements ClimbIO { + private static Elevator climber; protected Map devices; + public void idle(){ + climber.getMotorController().setDutyCycle(0); + } + public ClimbIOReal(Map devices) { this.devices = devices; + + climber = (Elevator) devices.get("lifter"); } @Override From d58180b649ae3687a83de36ca77f5e08e2413cf1 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Sat, 31 Jan 2026 15:08:02 -0500 Subject: [PATCH 071/371] Updated Launcher systems and made progress on IO systems --- simgui.json | 5 +- .../java/frc/robot/rebuilt/Constants.java | 3 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../rebuilt/commands/LauncherCommands.java | 62 ++++++++++++++----- .../robot/rebuilt/commands/TestCommands.java | 16 +---- .../rebuilt/subsystems/Launcher/Launcher.java | 26 ++++---- .../subsystems/Launcher/LauncherIO.java | 29 ++++----- .../subsystems/Launcher/LauncherIOReal.java | 26 +++++--- 8 files changed, 98 insertions(+), 71 deletions(-) diff --git a/simgui.json b/simgui.json index d22be11e..f04f1970 100644 --- a/simgui.json +++ b/simgui.json @@ -902,7 +902,10 @@ "left": 245, "right": 3942, "top": 118, - "width": 16.54119300842285 + "width": 16.54119300842285, + "window": { + "visible": true + } }, "/SmartDashboard/Robot Visual": { "window": { diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index b5bff742..e88e2502 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -19,8 +19,7 @@ public static class ClimbConstants { } public static class LauncherConstants { - public static final double UPPER_SHOOTER_TOLERANCE_RPM = 50.0; - public static final double LOWER_SHOOTER_TOLERANCE_RPM = 50.0; + public static final double SHOOTER_TOLERANCE_RPM = 50.0; public static final double HOOD_ANGLE_TOLERANCE_DEGREES = 1.0; public static final double TURRET_ANGLE_TOLERANCE_DEGREES = 1.0; } diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index e5ea9478..84790f29 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -51,7 +51,7 @@ public Rebuilt(String directory) { @Override public void configureButtonBindings(Controller driver, Controller operator) { climbCommands.configureButtonBindings(driver); - launcherCommands.configureButtonBindings(driver); + launcherCommands.configureButtonBindings(driver, operator); } @Override diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index b4f514b9..b068bef2 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -5,7 +5,6 @@ import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; @@ -28,9 +27,23 @@ public class LauncherCommands { private State prepState; private State readyState; private Launcher launcher; - private GenericDrivetrain drivetrain; + private static GenericDrivetrain drivetrain; private Map subsystems; - private Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); + private static Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); + + public static Translation2d getRobotToTarget() { + return target.minus(drivetrain.getPoseEstimator().getCurrentPose().getTranslation()); + } + //public static Angle getHoodAngle(Distance toTarget) {} Placeholder for now + + private static enum LauncherState { + IDLE, + LOW_SPEED, + PREP, + READY + } + + private static LauncherState requestedState = LauncherState.IDLE; public LauncherCommands(Map subsystems) { this.subsystems = subsystems; @@ -55,23 +68,26 @@ public void setDefaultCommands() { } } - public void configureButtonBindings(Controller controller) { + public void configureButtonBindings(Controller driver, Controller operator) { - Trigger rightBumper = controller.createRightBumper(); - Trigger leftBumper = controller.createLeftBumper(); + driver.createRightBumper().onTrue(shouldPrepCommand()).onFalse(shouldIdleCommand()); - lowState.switchTo(prepState).when(rightBumper); - prepState.switchTo(lowState).when(() -> !rightBumper.getAsBoolean()); + idleState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + idleState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); - prepState.switchTo(readyState).when(leftBumper); - readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); + lowState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + lowState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); - // if (lowState != null && lowState.isScheduled()) { + prepState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + prepState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + // prepState.switchTo(readyState).when(() -> requestedState == LauncherState.READY); PLACEHOLDER + // FOR NOW + + readyState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + readyState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + // readyState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); PLACEHOLDER + // FOR NOW - // launcher.setHoodAngle(Units.Degrees.of(0)); - // launcher.setLowerSpeed(0.5); - // launcher.setTurretRotation(Units.Degrees.of(0)); - // } } private Translation2d getTargetPose() { @@ -102,4 +118,20 @@ private Command readyStateCommand() { Commands.runOnce(() -> commandState.setValue("Ready")), launcher.trackTargetCommand(() -> getTargetPose())); } + + public Command shouldIdleCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.IDLE); + } + + public Command shouldLowCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.LOW_SPEED); + } + + public Command shouldPrepCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.PREP); + } + + public Command shouldReadyCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.READY); + } } diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 223979c0..bf4707bf 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -54,25 +54,13 @@ public Command testLauncherCommand(double speed, double time) { .andThen( (Commands.run( () -> { - launcher.setUpperSpeed(speed); + launcher.runShooter(speed); })) .withTimeout(time)) .andThen( (Commands.run( () -> { - launcher.setUpperSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(0); + launcher.runShooter(0); })) .withTimeout(time)) .andThen( diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index e85befca..b102179d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -59,15 +59,7 @@ public void simulationPeriodic() { * @param speed the speed to set the upper shooter motor to, in units of RPM. */ public void runShooter(double speed) { - io.setUpperSpeed(speed); - } - - public void setUpperSpeed(double speed) { - io.setUpperSpeed(speed); - } - - public void setLowerSpeed(double speed) { - io.setLowerSpeed(speed); + io.runShooter(speed); } public void setHoodAngle(Angle angle) { @@ -78,6 +70,15 @@ public void setTurretRotation(Angle angle) { io.setTurretRotation(angle); } + public Command trackTargetCommand() { + return Commands.run( + () -> { + io.setHoodAngle(inputs.hoodAngleDesired); + io.setTurretRotation(inputs.turretAngleDesired); + io.runShooter(inputs.flyWheelSpeedDesired); + }); + } + /** * A command which tracks a target using the turret rotation and hood angle. The command will * continuously set the turret rotation and hood angle to the angle of the target relative to the @@ -114,10 +115,7 @@ public Command stopTrackingCommand() { * * @return true if the robot is at the desired speed and angle, false otherwise. */ - public boolean atGoal() { - return inputs.upperSpeedAtGoal - && inputs.lowerSpeedAtGoal - && inputs.hoodAngleAtGoal - && inputs.turretAngleAtGoal; + public boolean isAtGoal() { + return inputs.flyWheelSpeedAtGoal && inputs.hoodAngleAtGoal && inputs.turretAngleAtGoal; } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java index 852a08ad..fab069fa 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java @@ -1,8 +1,11 @@ package frc.robot.rebuilt.subsystems.Launcher; import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.Meters; +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; /** IO interface for the Launcher subsystem. */ @@ -10,43 +13,41 @@ public interface LauncherIO { @AutoLog public static class LauncherIOInputs { - public double upperSpeedDesired = 0.0; - public double lowerSpeedDesired = 0.0; + public double flyWheelSpeedDesired = 0.0; + public Angle hoodAngleDesired = Degrees.of(0.0); public Angle turretAngleDesired = Degrees.of(0.0); - public double upperSpeedActual = 0.0; - public double lowerSpeedActual = 0.0; + public double flyWheelSpeedActual = 0.0; public Angle hoodAngleActual = Degrees.of(0.0); public Angle turretAngleActual = Degrees.of(0.0); - public boolean upperSpeedAtGoal = false; - public boolean lowerSpeedAtGoal = false; + public boolean flyWheelSpeedAtGoal = false; public boolean hoodAngleAtGoal = false; public boolean turretAngleAtGoal = false; - public double upperSpeedError = 0.0; - public double lowerSpeedError = 0.0; + public double flyWheelSpeedError = 0.0; public double hoodAngleError = 0.0; public double turretAngleError = 0.0; public double hoodVelocity = 0.0; public double turretVelocity = 0.0; - public double upperMotorOutput = 0.0; - public double lowerMotorOutput = 0.0; + public double flyWheelMotorOutput = 0.0; + + public Translation2d robotToTarget = new Translation2d(); + + public Distance targetDistance = Meters.of(0.0); } public default void updateInputs(LauncherIOInputs inputs) {} public void runShooter(double speed); - public void setUpperSpeed(double speed); - - public void setLowerSpeed(double speed); - public void setHoodAngle(Angle angle); public void setTurretRotation(Angle angle); + public void trackTarget(); + public default void updateSimulation() {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index 775f1fe0..3af37c5f 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -6,11 +6,14 @@ import static edu.wpi.first.units.Units.Amps; import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.Meters; import static edu.wpi.first.units.Units.RPM; import static edu.wpi.first.units.Units.Second; +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.commands.LauncherCommands; import java.util.Map; import yams.mechanisms.positional.Arm; import yams.mechanisms.positional.Pivot; @@ -33,7 +36,7 @@ public LauncherIOReal(Map devices) { @Override public void updateInputs(LauncherIOInputs inputs) { - inputs.upperSpeedDesired = + inputs.flyWheelSpeedDesired = flyWheel .getMotorController() .getMechanismSetpointVelocity() @@ -44,20 +47,17 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.turretAngleDesired = Turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); - inputs.upperSpeedActual = flyWheel.getSpeed().in(RPM); + inputs.flyWheelSpeedActual = flyWheel.getSpeed().in(RPM); inputs.hoodAngleActual = Hood.getAngle(); inputs.turretAngleActual = Turret.getAngle(); - inputs.upperSpeedError = inputs.upperSpeedActual - inputs.upperSpeedDesired; - inputs.lowerSpeedError = inputs.lowerSpeedActual - inputs.lowerSpeedDesired; + inputs.flyWheelSpeedError = inputs.flyWheelSpeedActual - inputs.flyWheelSpeedDesired; inputs.hoodAngleError = inputs.hoodAngleActual.minus(inputs.hoodAngleDesired).in(Degrees); inputs.turretAngleError = inputs.turretAngleActual.minus(inputs.turretAngleDesired).in(Degrees); - inputs.upperSpeedAtGoal = - Math.abs(inputs.upperSpeedError) <= Constants.LauncherConstants.UPPER_SHOOTER_TOLERANCE_RPM; - inputs.lowerSpeedAtGoal = - Math.abs(inputs.lowerSpeedError) <= Constants.LauncherConstants.LOWER_SHOOTER_TOLERANCE_RPM; - inputs.hoodAngleAtGoal = + inputs.flyWheelSpeedAtGoal = + Math.abs(inputs.flyWheelSpeedError) <= Constants.LauncherConstants.SHOOTER_TOLERANCE_RPM; + inputs.flyWheelSpeedAtGoal = Math.abs(inputs.hoodAngleError) <= Constants.LauncherConstants.HOOD_ANGLE_TOLERANCE_DEGREES; inputs.turretAngleAtGoal = Math.abs(inputs.turretAngleError) @@ -66,7 +66,11 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.hoodVelocity = Hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); inputs.turretVelocity = Turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); - inputs.upperMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); + inputs.flyWheelMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); + + inputs.robotToTarget = LauncherCommands.getRobotToTarget(); + + inputs.targetDistance = Meters.of(inputs.robotToTarget.getDistance(new Translation2d())); } public void runShooter(double speed) { @@ -88,4 +92,6 @@ public void setHoodAngle(Angle angle) { public void setTurretRotation(Angle angle) { Turret.getMotorController().setPosition(angle); } + + public void trackTarget() {} // Placeholder } From c8376369ba40578b5a5b3b012e762a2ed0572f17 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 31 Jan 2026 15:13:14 -0500 Subject: [PATCH 072/371] intake sim and real and io and states and machines --- .../rebuilt/commands/IntakeCommands.java | 71 +++++++++++++++---- .../rebuilt/subsystems/Indexer/Indexer.java | 10 ++- .../rebuilt/subsystems/intake/Intake.java | 19 ++--- .../rebuilt/subsystems/intake/IntakeIO.java | 14 +++- .../subsystems/intake/IntakeIOReal.java | 34 ++++++++- .../subsystems/intake/IntakeIOSim.java | 2 + 6 files changed, 115 insertions(+), 35 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index e8f2335f..6a11eb3c 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -1,35 +1,78 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.sensors.Controller; public class IntakeCommands { - Indexer indexer; Intake intake; Map subsystems; StateMachine intakeStateMachine = new StateMachine("IntakeStateMachine"); + private static enum IntakeState { + RETRACTED, + RETRACTING, + INTAKING + } + + private static IntakeState requestedState = IntakeState.RETRACTED; + public IntakeCommands(Map subsystems) { this.subsystems = subsystems; intake = (Intake) subsystems.get(Constants.INTAKE); } - State retracting = - intakeStateMachine.addState( - "retracting", - Commands.print("RETRACTING") - .andThen(() -> intake.RunSpintake(0)) - .andThen(() -> intake.setPinionPosition(100))); - State intaking = - intakeStateMachine.addState( - "intaking", - Commands.print("INTAKING") - .andThen(() -> intake.RunSpintake(25)) - .andThen(() -> intake.setPinionPosition(0))); + State retracted = intakeStateMachine.addState("retracted", retractedCommand()); + + State retracting = intakeStateMachine.addState("retracting", retractingCommand()); + State intaking = intakeStateMachine.addState("intaking", intakingCommand()); + + public void configureButtonBindings(Controller controller) { + controller.setRightTrigger(controller.createRightTrigger()); + Trigger rightTrigger = new Trigger(() -> controller.getRightTrigger() > 0.25); + controller.setLeftTrigger(controller.createLeftTrigger()); + Trigger leftTrigger = new Trigger(() -> controller.getLeftTrigger() > 0.25); + rightTrigger.onTrue(shouldRetracting()).onFalse(shouldRetracted()); + retracting.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); + retracted.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); + intaking.switchTo(retracting).when(() -> requestedState == IntakeState.RETRACTING); + retracting.switchTo(retracted).when(() -> intake.isRetracted()); + } + + public Command intakingCommand() { + return Commands.print("INTAKING") + .andThen(() -> intake.RunSpintake(25)) + .andThen(() -> intake.setPinionPosition(0)); + } + + public Command retractingCommand() { + return Commands.print("RETRACTING") + .andThen(() -> intake.RunSpintake(0)) + .andThen(() -> intake.setPinionPosition(100)); + } + + public Command retractedCommand() { + return Commands.print("RETRACTED") + .andThen(() -> intake.RunSpintake(0)) + .andThen(() -> intake.setPinionPosition(0)); + } + + public Command shouldIntaking() { + return Commands.runOnce(() -> requestedState = IntakeState.INTAKING); + } + + public Command shouldRetracting() { + return Commands.runOnce(() -> requestedState = IntakeState.RETRACTING); + } + + public Command shouldRetracted() { + return Commands.runOnce(() -> requestedState = IntakeState.RETRACTED); + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index 84fe0b33..ed67e9a9 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -8,6 +8,7 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; +import frc.robot.rebuilt.subsystems.Indexer.IndexerIOInputsAutoLogged; import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; @@ -16,15 +17,12 @@ public class Indexer extends GenericSubsystem { private PercentControlMotor Spindexer; private final IndexerIO io; private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); - private PercentControlMotor transferFront; - private PercentControlMotor transferBack; + private PercentControlMotor Feeder; /** Creates a new Index. */ public Indexer() { super("indexer.json"); - Spindexer = (PercentControlMotor) devices.get("spindexer"); - transferFront = (PercentControlMotor) devices.get("transfer_front"); - transferBack = (PercentControlMotor) devices.get("transfer_back"); + if (RobotBase.isSimulation()) { io = new IndexerIOSim(devices); } else { @@ -37,7 +35,7 @@ public void RunSpindexer(double speed) { } public void RunFeeder(double speed) { - transferFront.set(speed); + Feeder.set(speed); } public void ConfigController(Controller controller) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java index 1ff5285f..77d9d221 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java @@ -4,29 +4,20 @@ package frc.robot.rebuilt.subsystems.intake; -import static edu.wpi.first.units.Units.Meters; - -import edu.wpi.first.units.measure.Distance; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; -import yams.mechanisms.positional.Elevator; -import yams.mechanisms.velocity.FlyWheel; public class Intake extends GenericSubsystem { - private FlyWheel spintake; - private Elevator intakePinion; private IntakeIO io; private IntakeIOInputsAutoLogged inputs = new IntakeIOInputsAutoLogged(); /** Creates a new Intake. */ public Intake() { super("intake.json"); - spintake = (FlyWheel) devices.get("spintake"); - intakePinion = (Elevator) devices.get("pinion"); if (RobotBase.isSimulation()) { io = new IntakeIOSim(devices); } else { @@ -35,11 +26,10 @@ public Intake() { } public void RunSpintake(double speed) { - spintake.set(speed); + io.RunSpintake(speed); } public void ConfigController(Controller controller) { - controller.createLeftBumper().whileTrue(spintakeCommand(.25)); } public Command spintakeCommand(double speed) { @@ -54,8 +44,11 @@ public Command spintakeCommand(double speed) { } public void setPinionPosition(double position) { - Distance mydist = Meters.of(position); - intakePinion.setHeight(mydist); + io.setPinionPosition(position); + } + + public Boolean isRetracted() { + return io.isRetracted(); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java index 38c248d7..24529aca 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java @@ -1,10 +1,22 @@ package frc.robot.rebuilt.subsystems.intake; +import static edu.wpi.first.units.Units.Meters; + +import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; public interface IntakeIO { @AutoLog - public static class IntakeIOInputs {} + public static class IntakeIOInputs { + public double speed = 0.0; + public Distance position = Meters.of(0.0); + } + + public void RunSpintake(double speed); + + public void setPinionPosition(double position); + + public Boolean isRetracted(); public default void updateInputs(IntakeIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java index 6b71107c..f9100147 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java @@ -1,14 +1,46 @@ package frc.robot.rebuilt.subsystems.intake; +import static edu.wpi.first.units.Units.Inches; +import static edu.wpi.first.units.Units.Meters; +import static edu.wpi.first.units.Units.RPM; + +import edu.wpi.first.units.measure.Distance; import java.util.Map; +import yams.mechanisms.positional.Elevator; +import yams.mechanisms.velocity.FlyWheel; public class IntakeIOReal implements IntakeIO { protected Map devices; + private FlyWheel spintake; + private Elevator intakePinion; public IntakeIOReal(Map devices) { this.devices = devices; + spintake = (FlyWheel) devices.get("spintake"); + intakePinion = (Elevator) devices.get("pinion"); + } + + public void RunSpintake(double speed) { + spintake.set(speed); + } + + public void setPinionPosition(double position) { + Distance mydist = Meters.of(position); + intakePinion.setHeight(mydist); + } + + public Boolean isRetracted() { + return (intakePinion.getHeight().isEquivalent(Inches.of(0))); } @Override - public void updateInputs(IntakeIOInputs inputs) {} + public void updateInputs(IntakeIOInputs inputs) { + inputs.position = intakePinion.getMotorController().getMeasurementPosition(); + inputs.speed = + spintake + .getMotorController() + .getMechanismSetpointVelocity() + .map(it -> it.in(RPM)) + .orElse(0.0); + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java index 0282f7e6..5ae5327f 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java @@ -23,4 +23,6 @@ public IntakeIOSim(Map devices) { IntakeSimulation.IntakeSide.BACK, 1); } + + public void RunSpintake() {} } From d0097cca1b3a18b86f61d5036c3b26cd94dc9d99 Mon Sep 17 00:00:00 2001 From: pkatzfey Date: Sat, 31 Jan 2026 15:29:52 -0500 Subject: [PATCH 073/371] Initiation on Indexer Initiate Indexer class --- .../rebuilt/commands/IndexerCommands.java | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index 2fe6b13b..b10c18c9 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -3,12 +3,39 @@ import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; + +import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; public class IndexerCommands { - private Map subsystems; + private Map subsystems; + private StateMachine stateMachine; + private State idleState; + private State churnState; + private State feedState; + + public IndexerCommands(Map subsystems) { + this.subsystems = subsystems; + + // Create a simple state machine for the indexer and set it as the default command. + Indexer indexer = (Indexer) subsystems.get(Constants.INDEXER); + stateMachine = new StateMachine("IndexStateMachine"); + + idleState = stateMachine.addState("idle", Commands.idle()); + if (indexer != null) { + churnState = stateMachine.addState("churn", indexer.spindexerCommand(0)); + feedState = stateMachine.addState("feed", indexer.spindexerCommand(1)); + } + stateMachine.setInitialState(idleState); + + if (indexer != null) { + stateMachine.addRequirements(indexer); + indexer.setDefaultCommand(stateMachine); + } - public IndexerCommands(Map subsystems) { - this.subsystems = subsystems; - } + } } From 09f7247c0c40898d7dc472673b516e180e18c133 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 15:37:04 -0500 Subject: [PATCH 074/371] Refactor Climb subsystem and enhance state tracking Refactored Climb subsystem to use Distance type for height, updated ClimbIO interface and implementation, and improved state machine in ClimbCommands with telemetry for command state. Button bindings for climb commands now use the operator controller. Also updated simgui JSON files for new dashboard elements and visibility settings. Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- simgui-ds.json | 3 + simgui.json | 20 ++++++- src/main/java/frc/robot/BuildConstants.java | 10 ++-- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../robot/rebuilt/commands/ClimbCommands.java | 55 ++++++++++++++++--- .../robot/rebuilt/subsystems/Climb/Climb.java | 27 ++++----- .../rebuilt/subsystems/Climb/ClimbIO.java | 11 +++- .../rebuilt/subsystems/Climb/ClimbIOReal.java | 19 +++++-- 8 files changed, 108 insertions(+), 39 deletions(-) diff --git a/simgui-ds.json b/simgui-ds.json index 56cfde4a..0aefdb7d 100644 --- a/simgui-ds.json +++ b/simgui-ds.json @@ -100,6 +100,9 @@ "guid": "78696e70757401000000000000000000", "name": "Driver", "useGamepad": true + }, + { + "guid": "Keyboard0" } ] } diff --git a/simgui.json b/simgui.json index d22be11e..52695b97 100644 --- a/simgui.json +++ b/simgui.json @@ -902,7 +902,10 @@ "left": 245, "right": 3942, "top": 118, - "width": 16.54119300842285 + "width": 16.54119300842285, + "window": { + "visible": true + } }, "/SmartDashboard/Robot Visual": { "window": { @@ -930,6 +933,11 @@ "visible": true } }, + "/SmartDashboard/lifter/mechanism": { + "window": { + "visible": true + } + }, "/SmartDashboard/pinion/mechanism": { "window": { "visible": true @@ -1004,6 +1012,9 @@ "open": true }, "Shuffleboard": { + ".metadata": { + "open": true + }, "ExampleSubsystem": { "percent_motor": { "open": true @@ -1023,6 +1034,9 @@ }, "open": true }, + "ClimbCommands": { + "open": true + }, "Drive Feedforward": { "open": true }, @@ -1074,7 +1088,7 @@ } } }, - "NetworkTables View": { - "visible": false + "NetworkTables Info": { + "visible": true } } diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index f2670e01..c1bf8c98 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 191; - public static final String GIT_SHA = "dc3ed96bdfbf255f962ea0aea89f78afb9b6186c"; - public static final String GIT_DATE = "2026-01-31 13:22:55 EST"; + public static final int GIT_REVISION = 194; + public static final String GIT_SHA = "fae16a24242d3e806fb8ac4ae26deb82607b392b"; + public static final String GIT_DATE = "2026-01-31 14:47:34 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-31 14:23:24 EST"; - public static final long BUILD_UNIX_TIME = 1769887404744L; + public static final String BUILD_DATE = "2026-01-31 15:34:22 EST"; + public static final long BUILD_UNIX_TIME = 1769891662984L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index e5ea9478..0657a9a9 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -50,7 +50,7 @@ public Rebuilt(String directory) { @Override public void configureButtonBindings(Controller driver, Controller operator) { - climbCommands.configureButtonBindings(driver); + climbCommands.configureButtonBindings(operator); launcherCommands.configureButtonBindings(driver); } diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index 83a469fb..681d7f93 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -4,7 +4,6 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.Constants.ClimbConstants; import frc.robot.rebuilt.subsystems.Climb.Climb; @@ -13,6 +12,8 @@ import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; import org.frc5010.common.sensors.Controller; +import org.frc5010.common.telemetry.DisplayString; +import org.frc5010.common.telemetry.DisplayValuesHelper; public class ClimbCommands { @@ -23,6 +24,8 @@ public class ClimbCommands { private State descendState; private State liftedState; private State loweredState; + private DisplayString commandState; + private DisplayValuesHelper DisplayHelper; private static enum ClimbState { IDLE, @@ -39,15 +42,47 @@ private static enum ClimbState { public ClimbCommands(Map subsystems) { this.subsystems = subsystems; + DisplayHelper = new DisplayValuesHelper("ClimbCommands"); + commandState = DisplayHelper.makeDisplayString("Climb State"); + commandState.setValue(ClimbState.LOWERED.toString()); + // Create a simple state machine for climb and set it as the default command for the Climb climb = (Climb) subsystems.get(Constants.CLIMB); stateMachine = new StateMachine("ClimbStateMachine"); // a simple idle state; transitions will be added in configureButtonBindings - idleState = stateMachine.addState("idle", climb.idleCommand()); + idleState = + stateMachine.addState( + "idle", + climb + .idleCommand() + .alongWith( + Commands.runOnce(() -> commandState.setValue(ClimbState.IDLE.toString())))); + loweredState = + stateMachine.addState( + "lowered", + Commands.runOnce(() -> commandState.setValue(ClimbState.LOWERED.toString()))); + liftedState = + stateMachine.addState( + "lifted", Commands.runOnce(() -> commandState.setValue(ClimbState.LIFTED.toString()))); + // states that actually run the climber if (climb != null) { - elevateState = stateMachine.addState("elevate", climb.climberCommand(.5)); - descendState = stateMachine.addState("lower", climb.climberCommand(0)); + elevateState = + stateMachine.addState( + "elevate", + climb + .climberCommand(Meters.of(.5)) + .alongWith( + Commands.runOnce( + () -> commandState.setValue(ClimbState.ELEVATE.toString())))); + descendState = + stateMachine.addState( + "lower", + climb + .climberCommand(Meters.of(0)) + .alongWith( + Commands.runOnce( + () -> commandState.setValue(ClimbState.DESCEND.toString())))); } else { // fallback states if climb isn't available elevateState = stateMachine.addState("elevate", Commands.idle()); @@ -79,16 +114,14 @@ public void configureButtonBindings(Controller operator) { operator.createYButton().onTrue(shouldDescendCommand()).onFalse(shouldStopCommand()); - // create Trigger objects for clarity and reuse - Trigger rightBumper = operator.createXButton(); - Trigger leftBumper = operator.createYButton(); - // lowered -> elevate when requested loweredState.switchTo(elevateState).when(() -> requestedState == ClimbState.ELEVATE); // descend -> lowered when height is Zero descendState.switchTo(loweredState).when(() -> climb.getHeight().isEquivalent(Meters.of(0))); // elevate -> Lifted when height is =to Target - elevateState.switchTo(liftedState).when(() -> climb.getHeight().isEquivalent(ClimbConstants.MAX)); + elevateState + .switchTo(liftedState) + .when(() -> climb.getHeight().isEquivalent(ClimbConstants.MAX)); // lifted -> descend when asked to descend liftedState.switchTo(descendState).when(() -> requestedState == ClimbState.DESCEND); // elevate -> descend when asked to descend @@ -99,5 +132,9 @@ public void configureButtonBindings(Controller operator) { elevateState.switchTo(idleState).when(() -> requestedState == ClimbState.IDLE); // descend -> idle when stopped descendState.switchTo(idleState).when(() -> requestedState == ClimbState.IDLE); + // idle -> elevate when requested + idleState.switchTo(elevateState).when(() -> requestedState == ClimbState.ELEVATE); + // idle -> descend when requested + idleState.switchTo(descendState).when(() -> requestedState == ClimbState.DESCEND); } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 2195af90..7913a611 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -22,25 +22,27 @@ public class Climb extends GenericSubsystem { private final ClimbIO io; private final ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); - public Command climberCommand(double height) { + public Command climberCommand(Distance height) { return Commands.run( () -> { - setHeight(height); + setClimbHeight(height); }) .finallyDo( () -> { - setHeight(0); + setClimbHeight(Meters.of(0)); }); } - - public Command idleCommand(){ - return Commands.runOnce(() -> { - io.idle(); - }, this); + + public Command idleCommand() { + return Commands.runOnce( + () -> { + io.idle(); + }, + this); } public void ConfigController(Controller controller) { - controller.createBButton().whileTrue(climberCommand(.5)); + controller.createBButton().whileTrue(climberCommand(Meters.of(.5))); } public Climb() { @@ -52,13 +54,12 @@ public Climb() { } } - public void setHeight(double height) { - Distance mydist = Meters.of(height); - climber.getMotorController().setPosition(mydist); + public void setClimbHeight(Distance height) { + io.setHeight(height); } public Distance getHeight() { - return climber.getHeight(); + return inputs.climbHeight; } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java index ba3e9312..b19ec6e8 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIO.java @@ -1,14 +1,21 @@ package frc.robot.rebuilt.subsystems.Climb; +import static edu.wpi.first.units.Units.Inches; + +import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; /** IO interface for the Launcher subsystem. */ public interface ClimbIO { @AutoLog - public static class ClimbIOInputs {} + public static class ClimbIOInputs { + public Distance climbHeight = Inches.of(0); + } + + public void idle(); - public void idle (); + public void setHeight(Distance height); public default void updateInputs(ClimbIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java index 85858444..360acf41 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java @@ -4,26 +4,33 @@ package frc.robot.rebuilt.subsystems.Climb; +import edu.wpi.first.units.measure.Distance; import java.util.Map; - import yams.mechanisms.positional.Elevator; /** Add your docs here. */ public class ClimbIOReal implements ClimbIO { - private static Elevator climber; + private static Elevator climber; protected Map devices; - public void idle(){ - climber.getMotorController().setDutyCycle(0); + public void idle() { + climber.getMotorController().setDutyCycle(0); } public ClimbIOReal(Map devices) { this.devices = devices; - climber = (Elevator) devices.get("lifter"); + climber = (Elevator) devices.get("lifter"); } @Override - public void updateInputs(ClimbIOInputs inputs) {} + public void updateInputs(ClimbIOInputs inputs) { + + inputs.climbHeight = climber.getHeight(); + } + + public void setHeight(Distance height) { + climber.getMotorController().setPosition(height); + } } From a3833eccdd985f7754aa225628e90b004998a935 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 31 Jan 2026 15:39:48 -0500 Subject: [PATCH 075/371] Refactor subsystems and commands for state machines Introduces state machines for Intake, Indexer, and Launcher subsystems, refactors command binding logic, and updates IO interfaces and implementations for improved encapsulation and control. Launcher and Intake subsystems now use unified tolerance constants and updated method names. Removes redundant methods and fields, and improves command structure for better maintainability and clarity. Co-Authored-By: Aarush Jaiswal <78714918+saarushjaiswal@users.noreply.github.com> --- src/main/java/frc/robot/BuildConstants.java | 10 +-- .../java/frc/robot/rebuilt/Constants.java | 3 +- .../rebuilt/commands/IndexerCommands.java | 25 +++++++ .../rebuilt/commands/IntakeCommands.java | 71 +++++++++++++++---- .../rebuilt/commands/LauncherCommands.java | 62 ++++++++++++---- .../robot/rebuilt/commands/TestCommands.java | 16 +---- .../rebuilt/subsystems/Indexer/Indexer.java | 9 +-- .../rebuilt/subsystems/Launcher/Launcher.java | 26 ++++--- .../subsystems/Launcher/LauncherIO.java | 29 ++++---- .../subsystems/Launcher/LauncherIOReal.java | 26 ++++--- .../rebuilt/subsystems/intake/Intake.java | 22 ++---- .../rebuilt/subsystems/intake/IntakeIO.java | 14 +++- .../subsystems/intake/IntakeIOReal.java | 34 ++++++++- .../subsystems/intake/IntakeIOSim.java | 2 + 14 files changed, 238 insertions(+), 111 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index c1bf8c98..51630339 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -5,12 +5,12 @@ public final class BuildConstants { public static final String MAVEN_GROUP = ""; public static final String MAVEN_NAME = "rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 194; - public static final String GIT_SHA = "fae16a24242d3e806fb8ac4ae26deb82607b392b"; - public static final String GIT_DATE = "2026-01-31 14:47:34 EST"; + public static final int GIT_REVISION = 195; + public static final String GIT_SHA = "09f7247c0c40898d7dc472673b516e180e18c133"; + public static final String GIT_DATE = "2026-01-31 15:37:04 EST"; public static final String GIT_BRANCH = "Rebuilt"; - public static final String BUILD_DATE = "2026-01-31 15:34:22 EST"; - public static final long BUILD_UNIX_TIME = 1769891662984L; + public static final String BUILD_DATE = "2026-01-31 15:38:37 EST"; + public static final long BUILD_UNIX_TIME = 1769891917995L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/Constants.java b/src/main/java/frc/robot/rebuilt/Constants.java index b5bff742..e88e2502 100644 --- a/src/main/java/frc/robot/rebuilt/Constants.java +++ b/src/main/java/frc/robot/rebuilt/Constants.java @@ -19,8 +19,7 @@ public static class ClimbConstants { } public static class LauncherConstants { - public static final double UPPER_SHOOTER_TOLERANCE_RPM = 50.0; - public static final double LOWER_SHOOTER_TOLERANCE_RPM = 50.0; + public static final double SHOOTER_TOLERANCE_RPM = 50.0; public static final double HOOD_ANGLE_TOLERANCE_DEGREES = 1.0; public static final double TURRET_ANGLE_TOLERANCE_DEGREES = 1.0; } diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index 22e013e3..c65e3eab 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -1,12 +1,37 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.wpilibj2.command.Commands; +import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.subsystems.Indexer.Indexer; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; +import org.frc5010.common.arch.StateMachine; +import org.frc5010.common.arch.StateMachine.State; public class IndexerCommands { private Map subsystems; + private StateMachine stateMachine; + private State idleState; + private State churnState; + private State feedState; public IndexerCommands(Map subsystems) { this.subsystems = subsystems; + + // Create a simple state machine for the indexer and set it as the default command. + Indexer indexer = (Indexer) subsystems.get(Constants.INDEXER); + stateMachine = new StateMachine("IndexStateMachine"); + + idleState = stateMachine.addState("idle", Commands.idle()); + if (indexer != null) { + churnState = stateMachine.addState("churn", indexer.spindexerCommand(0)); + feedState = stateMachine.addState("feed", indexer.spindexerCommand(1)); + } + stateMachine.setInitialState(idleState); + + if (indexer != null) { + stateMachine.addRequirements(indexer); + indexer.setDefaultCommand(stateMachine); + } } } diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index e8f2335f..6a11eb3c 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -1,35 +1,78 @@ package frc.robot.rebuilt.commands; +import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; -import frc.robot.rebuilt.subsystems.Indexer.Indexer; import frc.robot.rebuilt.subsystems.intake.Intake; import java.util.Map; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; +import org.frc5010.common.sensors.Controller; public class IntakeCommands { - Indexer indexer; Intake intake; Map subsystems; StateMachine intakeStateMachine = new StateMachine("IntakeStateMachine"); + private static enum IntakeState { + RETRACTED, + RETRACTING, + INTAKING + } + + private static IntakeState requestedState = IntakeState.RETRACTED; + public IntakeCommands(Map subsystems) { this.subsystems = subsystems; intake = (Intake) subsystems.get(Constants.INTAKE); } - State retracting = - intakeStateMachine.addState( - "retracting", - Commands.print("RETRACTING") - .andThen(() -> intake.RunSpintake(0)) - .andThen(() -> intake.setPinionPosition(100))); - State intaking = - intakeStateMachine.addState( - "intaking", - Commands.print("INTAKING") - .andThen(() -> intake.RunSpintake(25)) - .andThen(() -> intake.setPinionPosition(0))); + State retracted = intakeStateMachine.addState("retracted", retractedCommand()); + + State retracting = intakeStateMachine.addState("retracting", retractingCommand()); + State intaking = intakeStateMachine.addState("intaking", intakingCommand()); + + public void configureButtonBindings(Controller controller) { + controller.setRightTrigger(controller.createRightTrigger()); + Trigger rightTrigger = new Trigger(() -> controller.getRightTrigger() > 0.25); + controller.setLeftTrigger(controller.createLeftTrigger()); + Trigger leftTrigger = new Trigger(() -> controller.getLeftTrigger() > 0.25); + rightTrigger.onTrue(shouldRetracting()).onFalse(shouldRetracted()); + retracting.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); + retracted.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); + intaking.switchTo(retracting).when(() -> requestedState == IntakeState.RETRACTING); + retracting.switchTo(retracted).when(() -> intake.isRetracted()); + } + + public Command intakingCommand() { + return Commands.print("INTAKING") + .andThen(() -> intake.RunSpintake(25)) + .andThen(() -> intake.setPinionPosition(0)); + } + + public Command retractingCommand() { + return Commands.print("RETRACTING") + .andThen(() -> intake.RunSpintake(0)) + .andThen(() -> intake.setPinionPosition(100)); + } + + public Command retractedCommand() { + return Commands.print("RETRACTED") + .andThen(() -> intake.RunSpintake(0)) + .andThen(() -> intake.setPinionPosition(0)); + } + + public Command shouldIntaking() { + return Commands.runOnce(() -> requestedState = IntakeState.INTAKING); + } + + public Command shouldRetracting() { + return Commands.runOnce(() -> requestedState = IntakeState.RETRACTING); + } + + public Command shouldRetracted() { + return Commands.runOnce(() -> requestedState = IntakeState.RETRACTED); + } } diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index b4f514b9..ca5a38a5 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -5,7 +5,6 @@ import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; -import edu.wpi.first.wpilibj2.command.button.Trigger; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.subsystems.Launcher.Launcher; import java.util.Map; @@ -28,9 +27,23 @@ public class LauncherCommands { private State prepState; private State readyState; private Launcher launcher; - private GenericDrivetrain drivetrain; + private static GenericDrivetrain drivetrain; private Map subsystems; - private Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); + private static Translation2d target = new Translation2d(Inches.of(182.11), Inches.of(158.84)); + + public static Translation2d getRobotToTarget() { + return target.minus(drivetrain.getPoseEstimator().getCurrentPose().getTranslation()); + } + // public static Angle getHoodAngle(Distance toTarget) {} Placeholder for now + + private static enum LauncherState { + IDLE, + LOW_SPEED, + PREP, + READY + } + + private static LauncherState requestedState = LauncherState.IDLE; public LauncherCommands(Map subsystems) { this.subsystems = subsystems; @@ -55,23 +68,26 @@ public void setDefaultCommands() { } } - public void configureButtonBindings(Controller controller) { + public void configureButtonBindings(Controller driver, Controller operator) { - Trigger rightBumper = controller.createRightBumper(); - Trigger leftBumper = controller.createLeftBumper(); + driver.createRightBumper().onTrue(shouldPrepCommand()).onFalse(shouldIdleCommand()); - lowState.switchTo(prepState).when(rightBumper); - prepState.switchTo(lowState).when(() -> !rightBumper.getAsBoolean()); + idleState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + idleState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); - prepState.switchTo(readyState).when(leftBumper); - readyState.switchTo(lowState).when(() -> !leftBumper.getAsBoolean()); + lowState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + lowState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); - // if (lowState != null && lowState.isScheduled()) { + prepState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + prepState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + // prepState.switchTo(readyState).when(() -> requestedState == LauncherState.READY); PLACEHOLDER + // FOR NOW + + readyState.switchTo(idleState).when(() -> requestedState == LauncherState.IDLE); + readyState.switchTo(lowState).when(() -> requestedState == LauncherState.LOW_SPEED); + // readyState.switchTo(prepState).when(() -> requestedState == LauncherState.PREP); PLACEHOLDER + // FOR NOW - // launcher.setHoodAngle(Units.Degrees.of(0)); - // launcher.setLowerSpeed(0.5); - // launcher.setTurretRotation(Units.Degrees.of(0)); - // } } private Translation2d getTargetPose() { @@ -102,4 +118,20 @@ private Command readyStateCommand() { Commands.runOnce(() -> commandState.setValue("Ready")), launcher.trackTargetCommand(() -> getTargetPose())); } + + public Command shouldIdleCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.IDLE); + } + + public Command shouldLowCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.LOW_SPEED); + } + + public Command shouldPrepCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.PREP); + } + + public Command shouldReadyCommand() { + return Commands.runOnce(() -> requestedState = LauncherState.READY); + } } diff --git a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java index 223979c0..bf4707bf 100644 --- a/src/main/java/frc/robot/rebuilt/commands/TestCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/TestCommands.java @@ -54,25 +54,13 @@ public Command testLauncherCommand(double speed, double time) { .andThen( (Commands.run( () -> { - launcher.setUpperSpeed(speed); + launcher.runShooter(speed); })) .withTimeout(time)) .andThen( (Commands.run( () -> { - launcher.setUpperSpeed(0); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(speed); - })) - .withTimeout(time)) - .andThen( - (Commands.run( - () -> { - launcher.setLowerSpeed(0); + launcher.runShooter(0); })) .withTimeout(time)) .andThen( diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index 84fe0b33..afb64840 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -16,15 +16,12 @@ public class Indexer extends GenericSubsystem { private PercentControlMotor Spindexer; private final IndexerIO io; private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); - private PercentControlMotor transferFront; - private PercentControlMotor transferBack; + private PercentControlMotor Feeder; /** Creates a new Index. */ public Indexer() { super("indexer.json"); - Spindexer = (PercentControlMotor) devices.get("spindexer"); - transferFront = (PercentControlMotor) devices.get("transfer_front"); - transferBack = (PercentControlMotor) devices.get("transfer_back"); + if (RobotBase.isSimulation()) { io = new IndexerIOSim(devices); } else { @@ -37,7 +34,7 @@ public void RunSpindexer(double speed) { } public void RunFeeder(double speed) { - transferFront.set(speed); + Feeder.set(speed); } public void ConfigController(Controller controller) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index e85befca..b102179d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -59,15 +59,7 @@ public void simulationPeriodic() { * @param speed the speed to set the upper shooter motor to, in units of RPM. */ public void runShooter(double speed) { - io.setUpperSpeed(speed); - } - - public void setUpperSpeed(double speed) { - io.setUpperSpeed(speed); - } - - public void setLowerSpeed(double speed) { - io.setLowerSpeed(speed); + io.runShooter(speed); } public void setHoodAngle(Angle angle) { @@ -78,6 +70,15 @@ public void setTurretRotation(Angle angle) { io.setTurretRotation(angle); } + public Command trackTargetCommand() { + return Commands.run( + () -> { + io.setHoodAngle(inputs.hoodAngleDesired); + io.setTurretRotation(inputs.turretAngleDesired); + io.runShooter(inputs.flyWheelSpeedDesired); + }); + } + /** * A command which tracks a target using the turret rotation and hood angle. The command will * continuously set the turret rotation and hood angle to the angle of the target relative to the @@ -114,10 +115,7 @@ public Command stopTrackingCommand() { * * @return true if the robot is at the desired speed and angle, false otherwise. */ - public boolean atGoal() { - return inputs.upperSpeedAtGoal - && inputs.lowerSpeedAtGoal - && inputs.hoodAngleAtGoal - && inputs.turretAngleAtGoal; + public boolean isAtGoal() { + return inputs.flyWheelSpeedAtGoal && inputs.hoodAngleAtGoal && inputs.turretAngleAtGoal; } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java index 852a08ad..fab069fa 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java @@ -1,8 +1,11 @@ package frc.robot.rebuilt.subsystems.Launcher; import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.Meters; +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; /** IO interface for the Launcher subsystem. */ @@ -10,43 +13,41 @@ public interface LauncherIO { @AutoLog public static class LauncherIOInputs { - public double upperSpeedDesired = 0.0; - public double lowerSpeedDesired = 0.0; + public double flyWheelSpeedDesired = 0.0; + public Angle hoodAngleDesired = Degrees.of(0.0); public Angle turretAngleDesired = Degrees.of(0.0); - public double upperSpeedActual = 0.0; - public double lowerSpeedActual = 0.0; + public double flyWheelSpeedActual = 0.0; public Angle hoodAngleActual = Degrees.of(0.0); public Angle turretAngleActual = Degrees.of(0.0); - public boolean upperSpeedAtGoal = false; - public boolean lowerSpeedAtGoal = false; + public boolean flyWheelSpeedAtGoal = false; public boolean hoodAngleAtGoal = false; public boolean turretAngleAtGoal = false; - public double upperSpeedError = 0.0; - public double lowerSpeedError = 0.0; + public double flyWheelSpeedError = 0.0; public double hoodAngleError = 0.0; public double turretAngleError = 0.0; public double hoodVelocity = 0.0; public double turretVelocity = 0.0; - public double upperMotorOutput = 0.0; - public double lowerMotorOutput = 0.0; + public double flyWheelMotorOutput = 0.0; + + public Translation2d robotToTarget = new Translation2d(); + + public Distance targetDistance = Meters.of(0.0); } public default void updateInputs(LauncherIOInputs inputs) {} public void runShooter(double speed); - public void setUpperSpeed(double speed); - - public void setLowerSpeed(double speed); - public void setHoodAngle(Angle angle); public void setTurretRotation(Angle angle); + public void trackTarget(); + public default void updateSimulation() {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index 775f1fe0..3af37c5f 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -6,11 +6,14 @@ import static edu.wpi.first.units.Units.Amps; import static edu.wpi.first.units.Units.Degrees; +import static edu.wpi.first.units.Units.Meters; import static edu.wpi.first.units.Units.RPM; import static edu.wpi.first.units.Units.Second; +import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; import frc.robot.rebuilt.Constants; +import frc.robot.rebuilt.commands.LauncherCommands; import java.util.Map; import yams.mechanisms.positional.Arm; import yams.mechanisms.positional.Pivot; @@ -33,7 +36,7 @@ public LauncherIOReal(Map devices) { @Override public void updateInputs(LauncherIOInputs inputs) { - inputs.upperSpeedDesired = + inputs.flyWheelSpeedDesired = flyWheel .getMotorController() .getMechanismSetpointVelocity() @@ -44,20 +47,17 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.turretAngleDesired = Turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); - inputs.upperSpeedActual = flyWheel.getSpeed().in(RPM); + inputs.flyWheelSpeedActual = flyWheel.getSpeed().in(RPM); inputs.hoodAngleActual = Hood.getAngle(); inputs.turretAngleActual = Turret.getAngle(); - inputs.upperSpeedError = inputs.upperSpeedActual - inputs.upperSpeedDesired; - inputs.lowerSpeedError = inputs.lowerSpeedActual - inputs.lowerSpeedDesired; + inputs.flyWheelSpeedError = inputs.flyWheelSpeedActual - inputs.flyWheelSpeedDesired; inputs.hoodAngleError = inputs.hoodAngleActual.minus(inputs.hoodAngleDesired).in(Degrees); inputs.turretAngleError = inputs.turretAngleActual.minus(inputs.turretAngleDesired).in(Degrees); - inputs.upperSpeedAtGoal = - Math.abs(inputs.upperSpeedError) <= Constants.LauncherConstants.UPPER_SHOOTER_TOLERANCE_RPM; - inputs.lowerSpeedAtGoal = - Math.abs(inputs.lowerSpeedError) <= Constants.LauncherConstants.LOWER_SHOOTER_TOLERANCE_RPM; - inputs.hoodAngleAtGoal = + inputs.flyWheelSpeedAtGoal = + Math.abs(inputs.flyWheelSpeedError) <= Constants.LauncherConstants.SHOOTER_TOLERANCE_RPM; + inputs.flyWheelSpeedAtGoal = Math.abs(inputs.hoodAngleError) <= Constants.LauncherConstants.HOOD_ANGLE_TOLERANCE_DEGREES; inputs.turretAngleAtGoal = Math.abs(inputs.turretAngleError) @@ -66,7 +66,11 @@ public void updateInputs(LauncherIOInputs inputs) { inputs.hoodVelocity = Hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); inputs.turretVelocity = Turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); - inputs.upperMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); + inputs.flyWheelMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); + + inputs.robotToTarget = LauncherCommands.getRobotToTarget(); + + inputs.targetDistance = Meters.of(inputs.robotToTarget.getDistance(new Translation2d())); } public void runShooter(double speed) { @@ -88,4 +92,6 @@ public void setHoodAngle(Angle angle) { public void setTurretRotation(Angle angle) { Turret.getMotorController().setPosition(angle); } + + public void trackTarget() {} // Placeholder } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java index 1ff5285f..802cb313 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/Intake.java @@ -4,29 +4,20 @@ package frc.robot.rebuilt.subsystems.intake; -import static edu.wpi.first.units.Units.Meters; - -import edu.wpi.first.units.measure.Distance; import edu.wpi.first.wpilibj.RobotBase; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; -import yams.mechanisms.positional.Elevator; -import yams.mechanisms.velocity.FlyWheel; public class Intake extends GenericSubsystem { - private FlyWheel spintake; - private Elevator intakePinion; private IntakeIO io; private IntakeIOInputsAutoLogged inputs = new IntakeIOInputsAutoLogged(); /** Creates a new Intake. */ public Intake() { super("intake.json"); - spintake = (FlyWheel) devices.get("spintake"); - intakePinion = (Elevator) devices.get("pinion"); if (RobotBase.isSimulation()) { io = new IntakeIOSim(devices); } else { @@ -35,12 +26,10 @@ public Intake() { } public void RunSpintake(double speed) { - spintake.set(speed); + io.RunSpintake(speed); } - public void ConfigController(Controller controller) { - controller.createLeftBumper().whileTrue(spintakeCommand(.25)); - } + public void ConfigController(Controller controller) {} public Command spintakeCommand(double speed) { return Commands.run( @@ -54,8 +43,11 @@ public Command spintakeCommand(double speed) { } public void setPinionPosition(double position) { - Distance mydist = Meters.of(position); - intakePinion.setHeight(mydist); + io.setPinionPosition(position); + } + + public Boolean isRetracted() { + return io.isRetracted(); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java index 38c248d7..24529aca 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIO.java @@ -1,10 +1,22 @@ package frc.robot.rebuilt.subsystems.intake; +import static edu.wpi.first.units.Units.Meters; + +import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; public interface IntakeIO { @AutoLog - public static class IntakeIOInputs {} + public static class IntakeIOInputs { + public double speed = 0.0; + public Distance position = Meters.of(0.0); + } + + public void RunSpintake(double speed); + + public void setPinionPosition(double position); + + public Boolean isRetracted(); public default void updateInputs(IntakeIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java index 6b71107c..f9100147 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOReal.java @@ -1,14 +1,46 @@ package frc.robot.rebuilt.subsystems.intake; +import static edu.wpi.first.units.Units.Inches; +import static edu.wpi.first.units.Units.Meters; +import static edu.wpi.first.units.Units.RPM; + +import edu.wpi.first.units.measure.Distance; import java.util.Map; +import yams.mechanisms.positional.Elevator; +import yams.mechanisms.velocity.FlyWheel; public class IntakeIOReal implements IntakeIO { protected Map devices; + private FlyWheel spintake; + private Elevator intakePinion; public IntakeIOReal(Map devices) { this.devices = devices; + spintake = (FlyWheel) devices.get("spintake"); + intakePinion = (Elevator) devices.get("pinion"); + } + + public void RunSpintake(double speed) { + spintake.set(speed); + } + + public void setPinionPosition(double position) { + Distance mydist = Meters.of(position); + intakePinion.setHeight(mydist); + } + + public Boolean isRetracted() { + return (intakePinion.getHeight().isEquivalent(Inches.of(0))); } @Override - public void updateInputs(IntakeIOInputs inputs) {} + public void updateInputs(IntakeIOInputs inputs) { + inputs.position = intakePinion.getMotorController().getMeasurementPosition(); + inputs.speed = + spintake + .getMotorController() + .getMechanismSetpointVelocity() + .map(it -> it.in(RPM)) + .orElse(0.0); + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java index 0282f7e6..5ae5327f 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/intake/IntakeIOSim.java @@ -23,4 +23,6 @@ public IntakeIOSim(Map devices) { IntakeSimulation.IntakeSide.BACK, 1); } + + public void RunSpintake() {} } From de39c847da9a0a27eb8a484c2fb8fe71dc69fec1 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Sat, 31 Jan 2026 16:08:19 -0500 Subject: [PATCH 076/371] A few additonal updates --- src/main/deploy/tigershark/akit_swerve_drivetrain.json | 2 +- src/main/java/frc/robot/rebuilt/Rebuilt.java | 2 +- .../frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/deploy/tigershark/akit_swerve_drivetrain.json b/src/main/deploy/tigershark/akit_swerve_drivetrain.json index 20c05ad1..d8bbb88a 100644 --- a/src/main/deploy/tigershark/akit_swerve_drivetrain.json +++ b/src/main/deploy/tigershark/akit_swerve_drivetrain.json @@ -73,7 +73,7 @@ }, "encoderId": 13, "absoluteOffset": { - "val": 0.15234375, + "val": 0.064697265625, "uom": "rotations" }, "encoderInverted": false diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index 2a356029..bafa35b0 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -45,7 +45,7 @@ public Rebuilt(String directory) { testCommands = new TestCommands(subsystems); climbCommands = new ClimbCommands(subsystems); launcherCommands = new LauncherCommands(subsystems); - // intakecommands = new IntakeCommands(subsystems); + intakecommands = new IntakeCommands(subsystems); } @Override diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java index 094f6861..887b3943 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java @@ -4,7 +4,11 @@ public interface IndexerIO { @AutoLog - public static class IndexerIOInputs {} + public static class IndexerIOInputs { + public double spindexerSpeed = 0; + public double transferFrontSpeed = 0; + public double transferBackSpeed = 0; + } public default void updateInputs(IndexerIOInputs inputs) {} } From f7593c957085d4e7c2ac0102f18128fbd2f2d2dc Mon Sep 17 00:00:00 2001 From: Curt Date: Sun, 1 Feb 2026 18:05:05 -0500 Subject: [PATCH 077/371] Add field constants and shot calculator, update subsystems Introduces FieldConstants.java for field geometry and AprilTag positions, and adds ShotCalculator.java for dynamic shot parameter calculation. Refactors several subsystems and command classes to use new field constants, improves state logging with AutoLogOutput, and updates LauncherIO to use typed AngularVelocity for flywheel speed. Also fixes device initialization and method naming for clarity and consistency. --- .../frc/robot/rebuilt/FieldConstants.java | 368 ++++++++++++++++++ src/main/java/frc/robot/rebuilt/Rebuilt.java | 24 +- .../robot/rebuilt/commands/ClimbCommands.java | 6 +- .../rebuilt/commands/IndexerCommands.java | 4 +- .../rebuilt/commands/IntakeCommands.java | 7 + .../rebuilt/commands/LauncherCommands.java | 2 + .../robot/rebuilt/subsystems/Climb/Climb.java | 22 +- .../rebuilt/subsystems/Climb/ClimbIOReal.java | 8 +- .../subsystems/Indexer/IndexerIOReal.java | 5 +- .../rebuilt/subsystems/Launcher/Launcher.java | 8 +- .../subsystems/Launcher/LauncherIO.java | 12 +- .../subsystems/Launcher/LauncherIOReal.java | 51 +-- .../subsystems/Launcher/ShotCalculator.java | 187 +++++++++ 13 files changed, 638 insertions(+), 66 deletions(-) create mode 100644 src/main/java/frc/robot/rebuilt/FieldConstants.java create mode 100644 src/main/java/frc/robot/rebuilt/subsystems/Launcher/ShotCalculator.java diff --git a/src/main/java/frc/robot/rebuilt/FieldConstants.java b/src/main/java/frc/robot/rebuilt/FieldConstants.java new file mode 100644 index 00000000..49e77704 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/FieldConstants.java @@ -0,0 +1,368 @@ +// Copyright (c) 2025-2026 Littleton Robotics +// http://github.com/Mechanical-Advantage +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file at +// the root directory of this project. + +package frc.robot.rebuilt; + +import static edu.wpi.first.units.Units.Meters; + +import edu.wpi.first.math.geometry.Pose2d; +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.math.geometry.Translation3d; +import edu.wpi.first.math.util.Units; +import edu.wpi.first.units.measure.Distance; +import org.frc5010.common.vision.AprilTags; + +/** + * Contains information for location of field element and other useful reference points. + * + *

NOTE: All constants are defined relative to the field coordinate system, and from the + * perspective of the blue alliance station + */ +public class FieldConstants { + public static final FieldType fieldType = FieldType.ANDYMARK; + + // AprilTag related constants + public static final int aprilTagCount = AprilTags.aprilTagFieldLayout.getTags().size(); + public static final double aprilTagWidth = Units.inchesToMeters(6.5); + + // Field dimensions + public static final double fieldLength = AprilTags.aprilTagFieldLayout.getFieldLength(); + public static final double fieldWidth = AprilTags.aprilTagFieldLayout.getFieldWidth(); + public static final Distance FIELD_LENGTH = Meters.of(fieldLength); + public static final Distance FIELD_WIDTH = Meters.of(fieldWidth); + /** + * Officially defined and relevant vertical lines found on the field (defined by X-axis offset) + */ + public static class LinesVertical { + public static final double center = fieldLength / 2.0; + public static final double starting = AprilTags.aprilTagFieldLayout.getTagPose(26).get().getX(); + public static final double allianceZone = starting; + public static final double hubCenter = + AprilTags.aprilTagFieldLayout.getTagPose(26).get().getX() + Hub.width / 2.0; + public static final double neutralZoneNear = center - Units.inchesToMeters(120); + public static final double neutralZoneFar = center + Units.inchesToMeters(120); + public static final double oppHubCenter = + AprilTags.aprilTagFieldLayout.getTagPose(4).get().getX() + Hub.width / 2.0; + public static final double oppAllianceZone = + AprilTags.aprilTagFieldLayout.getTagPose(10).get().getX(); + } + + /** + * Officially defined and relevant horizontal lines found on the field (defined by Y-axis offset) + * + *

NOTE: The field element start and end are always left to right from the perspective of the + * alliance station + */ + public static class LinesHorizontal { + + public static final double center = fieldWidth / 2.0; + + // Right of hub + public static final double rightBumpStart = Hub.nearRightCorner.getY(); + public static final double rightBumpEnd = rightBumpStart - RightBump.width; + public static final double rightTrenchOpenStart = rightBumpEnd - Units.inchesToMeters(12.0); + public static final double rightTrenchOpenEnd = 0; + + // Left of hub + public static final double leftBumpEnd = Hub.nearLeftCorner.getY(); + public static final double leftBumpStart = leftBumpEnd + LeftBump.width; + public static final double leftTrenchOpenEnd = leftBumpStart + Units.inchesToMeters(12.0); + public static final double leftTrenchOpenStart = fieldWidth; + } + + /** Hub related constants */ + public static class Hub { + + // Dimensions + public static final double width = Units.inchesToMeters(47.0); + public static final double height = + Units.inchesToMeters(72.0); // includes the catcher at the top + public static final double innerWidth = Units.inchesToMeters(41.7); + public static final double innerHeight = Units.inchesToMeters(56.5); + + // Relevant reference points on alliance side + public static final Translation3d topCenterPoint = + new Translation3d( + AprilTags.aprilTagFieldLayout.getTagPose(26).get().getX() + width / 2.0, + fieldWidth / 2.0, + height); + public static final Translation3d innerCenterPoint = + new Translation3d( + AprilTags.aprilTagFieldLayout.getTagPose(26).get().getX() + width / 2.0, + fieldWidth / 2.0, + innerHeight); + + public static final Translation2d nearLeftCorner = + new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / 2.0); + public static final Translation2d nearRightCorner = + new Translation2d(topCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / 2.0); + public static final Translation2d farLeftCorner = + new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / 2.0); + public static final Translation2d farRightCorner = + new Translation2d(topCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / 2.0); + + // Relevant reference points on the opposite side + public static final Translation3d oppTopCenterPoint = + new Translation3d( + AprilTags.aprilTagFieldLayout.getTagPose(4).get().getX() + width / 2.0, + fieldWidth / 2.0, + height); + public static final Translation2d oppNearLeftCorner = + new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 + width / 2.0); + public static final Translation2d oppNearRightCorner = + new Translation2d(oppTopCenterPoint.getX() - width / 2.0, fieldWidth / 2.0 - width / 2.0); + public static final Translation2d oppFarLeftCorner = + new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 + width / 2.0); + public static final Translation2d oppFarRightCorner = + new Translation2d(oppTopCenterPoint.getX() + width / 2.0, fieldWidth / 2.0 - width / 2.0); + + // Hub faces + public static final Pose2d nearFace = + AprilTags.aprilTagFieldLayout.getTagPose(26).get().toPose2d(); + public static final Pose2d farFace = + AprilTags.aprilTagFieldLayout.getTagPose(20).get().toPose2d(); + public static final Pose2d rightFace = + AprilTags.aprilTagFieldLayout.getTagPose(18).get().toPose2d(); + public static final Pose2d leftFace = + AprilTags.aprilTagFieldLayout.getTagPose(21).get().toPose2d(); + } + + /** Left Bump related constants */ + public static class LeftBump { + + // Dimensions + public static final double width = Units.inchesToMeters(73.0); + public static final double height = Units.inchesToMeters(6.513); + public static final double depth = Units.inchesToMeters(44.4); + + // Relevant reference points on alliance side + public static final Translation2d nearLeftCorner = + new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); + public static final Translation2d nearRightCorner = Hub.nearLeftCorner; + public static final Translation2d farLeftCorner = + new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); + public static final Translation2d farRightCorner = Hub.farLeftCorner; + + // Relevant reference points on opposing side + public static final Translation2d oppNearLeftCorner = + new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); + public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; + public static final Translation2d oppFarLeftCorner = + new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); + public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; + } + + /** Right Bump related constants */ + public static class RightBump { + // Dimensions + public static final double width = Units.inchesToMeters(73.0); + public static final double height = Units.inchesToMeters(6.513); + public static final double depth = Units.inchesToMeters(44.4); + + // Relevant reference points on alliance side + public static final Translation2d nearLeftCorner = + new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); + public static final Translation2d nearRightCorner = Hub.nearLeftCorner; + public static final Translation2d farLeftCorner = + new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); + public static final Translation2d farRightCorner = Hub.farLeftCorner; + + // Relevant reference points on opposing side + public static final Translation2d oppNearLeftCorner = + new Translation2d(LinesVertical.hubCenter + width / 2, Units.inchesToMeters(255)); + public static final Translation2d oppNearRightCorner = Hub.oppNearLeftCorner; + public static final Translation2d oppFarLeftCorner = + new Translation2d(LinesVertical.hubCenter - width / 2, Units.inchesToMeters(255)); + public static final Translation2d oppFarRightCorner = Hub.oppFarLeftCorner; + } + + /** Left Trench related constants */ + public static class LeftTrench { + // Dimensions + public static final double width = Units.inchesToMeters(65.65); + public static final double depth = Units.inchesToMeters(47.0); + public static final double height = Units.inchesToMeters(40.25); + public static final double openingWidth = Units.inchesToMeters(50.34); + public static final double openingHeight = Units.inchesToMeters(22.25); + + // Relevant reference points on alliance side + public static final Translation3d openingTopLeft = + new Translation3d(LinesVertical.hubCenter, fieldWidth, openingHeight); + public static final Translation3d openingTopRight = + new Translation3d(LinesVertical.hubCenter, fieldWidth - openingWidth, openingHeight); + + // Relevant reference points on opposing side + public static final Translation3d oppOpeningTopLeft = + new Translation3d(LinesVertical.oppHubCenter, fieldWidth, openingHeight); + public static final Translation3d oppOpeningTopRight = + new Translation3d(LinesVertical.oppHubCenter, fieldWidth - openingWidth, openingHeight); + } + + public static class RightTrench { + + // Dimensions + public static final double width = Units.inchesToMeters(65.65); + public static final double depth = Units.inchesToMeters(47.0); + public static final double height = Units.inchesToMeters(40.25); + public static final double openingWidth = Units.inchesToMeters(50.34); + public static final double openingHeight = Units.inchesToMeters(22.25); + + // Relevant reference points on alliance side + public static final Translation3d openingTopLeft = + new Translation3d(LinesVertical.hubCenter, openingWidth, openingHeight); + public static final Translation3d openingTopRight = + new Translation3d(LinesVertical.hubCenter, 0, openingHeight); + + // Relevant reference points on opposing side + public static final Translation3d oppOpeningTopLeft = + new Translation3d(LinesVertical.oppHubCenter, openingWidth, openingHeight); + public static final Translation3d oppOpeningTopRight = + new Translation3d(LinesVertical.oppHubCenter, 0, openingHeight); + } + + /** Tower related constants */ + public static class Tower { + // Dimensions + public static final double width = Units.inchesToMeters(49.25); + public static final double depth = Units.inchesToMeters(45.0); + public static final double height = Units.inchesToMeters(78.25); + public static final double innerOpeningWidth = Units.inchesToMeters(32.250); + public static final double frontFaceX = Units.inchesToMeters(43.51); + + public static final double uprightHeight = Units.inchesToMeters(72.1); + + // Rung heights from the floor + public static final double lowRungHeight = Units.inchesToMeters(27.0); + public static final double midRungHeight = Units.inchesToMeters(45.0); + public static final double highRungHeight = Units.inchesToMeters(63.0); + + // Relevant reference points on alliance side + public static final Translation2d centerPoint = + new Translation2d(frontFaceX, AprilTags.aprilTagFieldLayout.getTagPose(31).get().getY()); + public static final Translation2d leftUpright = + new Translation2d( + frontFaceX, + (AprilTags.aprilTagFieldLayout.getTagPose(31).get().getY()) + + innerOpeningWidth / 2 + + Units.inchesToMeters(0.75)); + public static final Translation2d rightUpright = + new Translation2d( + frontFaceX, + (AprilTags.aprilTagFieldLayout.getTagPose(31).get().getY()) + - innerOpeningWidth / 2 + - Units.inchesToMeters(0.75)); + + // Relevant reference points on opposing side + public static final Translation2d oppCenterPoint = + new Translation2d( + fieldLength - frontFaceX, AprilTags.aprilTagFieldLayout.getTagPose(15).get().getY()); + public static final Translation2d oppLeftUpright = + new Translation2d( + fieldLength - frontFaceX, + (AprilTags.aprilTagFieldLayout.getTagPose(15).get().getY()) + + innerOpeningWidth / 2 + + Units.inchesToMeters(0.75)); + public static final Translation2d oppRightUpright = + new Translation2d( + fieldLength - frontFaceX, + (AprilTags.aprilTagFieldLayout.getTagPose(15).get().getY()) + - innerOpeningWidth / 2 + - Units.inchesToMeters(0.75)); + } + + public static class Depot { + // Dimensions + public static final double width = Units.inchesToMeters(42.0); + public static final double depth = Units.inchesToMeters(27.0); + public static final double height = Units.inchesToMeters(1.125); + public static final double distanceFromCenterY = Units.inchesToMeters(75.93); + + // Relevant reference points on alliance side + public static final Translation3d depotCenter = + new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY, height); + public static final Translation3d leftCorner = + new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY + (width / 2), height); + public static final Translation3d rightCorner = + new Translation3d(depth, (fieldWidth / 2) + distanceFromCenterY - (width / 2), height); + } + + public static class Outpost { + // Dimensions + public static final double width = Units.inchesToMeters(31.8); + public static final double openingDistanceFromFloor = Units.inchesToMeters(28.1); + public static final double height = Units.inchesToMeters(7.0); + + // Relevant reference points on alliance side + public static final Translation2d centerPoint = + new Translation2d(0, AprilTags.aprilTagFieldLayout.getTagPose(29).get().getY()); + } + + public enum FieldType { + ANDYMARK("andymark"), + WELDED("welded"); + + private final String jsonFolder; + + FieldType(String jsonFolder) { + this.jsonFolder = jsonFolder; + } + + public String getJsonFolder() { + return jsonFolder; + } + } + + // public enum AprilTagLayoutType { + // OFFICIAL("2026-official"), + // NONE("2026-none"); + + // private final String name; + // private volatile AprilTagFieldLayout layout; + // private volatile String layoutString; + + // AprilTagLayoutType(String name) { + // this.name = name; + // } + + // public AprilTagFieldLayout getLayout() { + // if (layout == null) { + // synchronized (this) { + // if (layout == null) { + // try { + // Path p = + // Constants.disableHAL + // ? Path.of( + // "src", + // "main", + // "deploy", + // "apriltags", + // fieldType.getJsonFolder(), + // name + ".json") + // : Path.of( + // Filesystem.getDeployDirectory().getPath(), + // "apriltags", + // fieldType.getJsonFolder(), + // name + ".json"); + // layout = new AprilTagFieldLayout(p); + // layoutString = new ObjectMapper().writeValueAsString(layout); + // } catch (IOException e) { + // throw new RuntimeException(e); + // } + // } + // } + // } + // return layout; + // } + + // public String getLayoutString() { + // if (layoutString == null) { + // getLayout(); + // } + // return layoutString; + // } + // } +} diff --git a/src/main/java/frc/robot/rebuilt/Rebuilt.java b/src/main/java/frc/robot/rebuilt/Rebuilt.java index bafa35b0..e39ad984 100644 --- a/src/main/java/frc/robot/rebuilt/Rebuilt.java +++ b/src/main/java/frc/robot/rebuilt/Rebuilt.java @@ -17,26 +17,26 @@ import frc.robot.rebuilt.subsystems.intake.Intake; import org.frc5010.common.arch.GenericRobot; import org.frc5010.common.config.ConfigConstants; -import org.frc5010.common.constants.SwerveConstants; import org.frc5010.common.drive.GenericDrivetrain; import org.frc5010.common.sensors.Controller; +import org.frc5010.common.utils.geometry.AllianceFlipUtil; /** This is an example robot class. */ public class Rebuilt extends GenericRobot { - SwerveConstants swerveConstants; - GenericDrivetrain drivetrain; - Indexer indexer; - Climb climb; - Intake intake; - Launcher launcher; - LauncherCommands launcherCommands; - AutoCommands autocommands; - ClimbCommands climbCommands; - IntakeCommands intakecommands; - TestCommands testCommands; + public static GenericDrivetrain drivetrain; + public static Indexer indexer; + public static Climb climb; + public static Intake intake; + public static Launcher launcher; + public static LauncherCommands launcherCommands; + public static AutoCommands autocommands; + public static ClimbCommands climbCommands; + public static IntakeCommands intakecommands; + public static TestCommands testCommands; public Rebuilt(String directory) { super(directory); + AllianceFlipUtil.configure(FieldConstants.FIELD_LENGTH, FieldConstants.FIELD_WIDTH); indexer = new Indexer(); climb = new Climb(); intake = new Intake(); diff --git a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java index 681d7f93..cd996dab 100644 --- a/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/ClimbCommands.java @@ -14,6 +14,7 @@ import org.frc5010.common.sensors.Controller; import org.frc5010.common.telemetry.DisplayString; import org.frc5010.common.telemetry.DisplayValuesHelper; +import org.littletonrobotics.junction.AutoLogOutput; public class ClimbCommands { @@ -37,10 +38,11 @@ private static enum ClimbState { Climb climb; + @AutoLogOutput(key = "ClimbCommands/RequestedClimbState") private static ClimbState requestedState = ClimbState.LOWERED; - public ClimbCommands(Map subsystems) { - this.subsystems = subsystems; + public ClimbCommands(Map systems) { + this.subsystems = systems; DisplayHelper = new DisplayValuesHelper("ClimbCommands"); commandState = DisplayHelper.makeDisplayString("Climb State"); diff --git a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java index c65e3eab..0f1d1ce5 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IndexerCommands.java @@ -15,8 +15,8 @@ public class IndexerCommands { private State churnState; private State feedState; - public IndexerCommands(Map subsystems) { - this.subsystems = subsystems; + public IndexerCommands(Map systems) { + this.subsystems = systems; // Create a simple state machine for the indexer and set it as the default command. Indexer indexer = (Indexer) subsystems.get(Constants.INDEXER); diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index 6a11eb3c..b66c739a 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -10,6 +10,7 @@ import org.frc5010.common.arch.StateMachine; import org.frc5010.common.arch.StateMachine.State; import org.frc5010.common.sensors.Controller; +import org.littletonrobotics.junction.AutoLogOutput; public class IntakeCommands { Intake intake; @@ -20,8 +21,10 @@ private static enum IntakeState { RETRACTED, RETRACTING, INTAKING + // TODO : Add OUTTAKING } + @AutoLogOutput(key = "IntakeCommands/RequestedIntakeState") private static IntakeState requestedState = IntakeState.RETRACTED; public IntakeCommands(Map subsystems) { @@ -39,7 +42,11 @@ public void configureButtonBindings(Controller controller) { Trigger rightTrigger = new Trigger(() -> controller.getRightTrigger() > 0.25); controller.setLeftTrigger(controller.createLeftTrigger()); Trigger leftTrigger = new Trigger(() -> controller.getLeftTrigger() > 0.25); + + // TODO: This should be intaking not retracting rightTrigger.onTrue(shouldRetracting()).onFalse(shouldRetracted()); + // TODO: Make left trigger do an outtaking state + retracting.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); retracted.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); intaking.switchTo(retracting).when(() -> requestedState == IntakeState.RETRACTING); diff --git a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java index ca5a38a5..f19755cc 100644 --- a/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/LauncherCommands.java @@ -16,6 +16,7 @@ import org.frc5010.common.sensors.Controller; import org.frc5010.common.telemetry.DisplayString; import org.frc5010.common.telemetry.DisplayValuesHelper; +import org.littletonrobotics.junction.AutoLogOutput; public class LauncherCommands { @@ -43,6 +44,7 @@ private static enum LauncherState { READY } + @AutoLogOutput(key = "LauncherCommands/RequestedLauncherState") private static LauncherState requestedState = LauncherState.IDLE; public LauncherCommands(Map subsystems) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java index 7913a611..5ee5e726 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/Climb.java @@ -13,15 +13,20 @@ import org.frc5010.common.arch.GenericSubsystem; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; -import yams.mechanisms.positional.Elevator; public class Climb extends GenericSubsystem { - /** Creates a new Climb. */ - private static Elevator climber; - private final ClimbIO io; private final ClimbIOInputsAutoLogged inputs = new ClimbIOInputsAutoLogged(); + public Climb() { + super("climb.json"); + if (RobotBase.isSimulation()) { + io = new ClimbIOSim(devices); + } else { + io = new ClimbIOReal(devices); + } + } + public Command climberCommand(Distance height) { return Commands.run( () -> { @@ -45,15 +50,6 @@ public void ConfigController(Controller controller) { controller.createBButton().whileTrue(climberCommand(Meters.of(.5))); } - public Climb() { - super("climb.json"); - if (RobotBase.isSimulation()) { - io = new ClimbIOSim(devices); - } else { - io = new ClimbIOReal(devices); - } - } - public void setClimbHeight(Distance height) { io.setHeight(height); } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java index 360acf41..522f313e 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Climb/ClimbIOReal.java @@ -14,10 +14,6 @@ public class ClimbIOReal implements ClimbIO { protected Map devices; - public void idle() { - climber.getMotorController().setDutyCycle(0); - } - public ClimbIOReal(Map devices) { this.devices = devices; @@ -30,6 +26,10 @@ public void updateInputs(ClimbIOInputs inputs) { inputs.climbHeight = climber.getHeight(); } + public void idle() { + climber.getMotorController().setDutyCycle(0); + } + public void setHeight(Distance height) { climber.getMotorController().setPosition(height); } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index 8d67d2ff..e536f5f3 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -1,6 +1,5 @@ package frc.robot.rebuilt.subsystems.Indexer; -import frc.robot.rebuilt.subsystems.Indexer.IndexerIO.IndexerIOInputs; import java.util.Map; public class IndexerIOReal implements IndexerIO { @@ -11,5 +10,7 @@ public IndexerIOReal(Map devices) { } @Override - public void updateInputs(IndexerIOInputs inputs) {} + public void updateInputs(IndexerIOInputs inputs) { + // TODO: Add update to input values + } } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java index b102179d..6140434d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/Launcher.java @@ -6,6 +6,8 @@ import static edu.wpi.first.units.Units.Degrees; +import edu.wpi.first.math.geometry.Rotation3d; +import edu.wpi.first.math.geometry.Transform3d; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; import edu.wpi.first.wpilibj.RobotBase; @@ -14,14 +16,18 @@ import java.util.function.Supplier; import org.frc5010.common.arch.GenericSubsystem; import org.littletonrobotics.junction.Logger; +import yams.mechanisms.positional.Pivot; public class Launcher extends GenericSubsystem { private final LauncherIO io; private final LauncherIOInputsAutoLogged inputs = new LauncherIOInputsAutoLogged(); + public static Transform3d robotToTurret = new Transform3d(); /** Creates a new Launcher. */ public Launcher() { super("launcher.json"); + Pivot turret = (Pivot) devices.get("turret"); + robotToTurret = new Transform3d(turret.getRelativeMechanismPosition(), new Rotation3d()); if (RobotBase.isSimulation()) { io = new LauncherIOSim(devices); @@ -75,7 +81,7 @@ public Command trackTargetCommand() { () -> { io.setHoodAngle(inputs.hoodAngleDesired); io.setTurretRotation(inputs.turretAngleDesired); - io.runShooter(inputs.flyWheelSpeedDesired); + io.setFlyWheelVelocity(inputs.flyWheelSpeedDesired); }); } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java index fab069fa..1ed14135 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIO.java @@ -2,9 +2,11 @@ import static edu.wpi.first.units.Units.Degrees; import static edu.wpi.first.units.Units.Meters; +import static edu.wpi.first.units.Units.RPM; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.units.measure.AngularVelocity; import edu.wpi.first.units.measure.Distance; import org.littletonrobotics.junction.AutoLog; @@ -13,12 +15,12 @@ public interface LauncherIO { @AutoLog public static class LauncherIOInputs { - public double flyWheelSpeedDesired = 0.0; + public AngularVelocity flyWheelSpeedDesired = RPM.of(0.0); public Angle hoodAngleDesired = Degrees.of(0.0); public Angle turretAngleDesired = Degrees.of(0.0); - public double flyWheelSpeedActual = 0.0; + public AngularVelocity flyWheelSpeedActual = RPM.of(0.0); public Angle hoodAngleActual = Degrees.of(0.0); public Angle turretAngleActual = Degrees.of(0.0); @@ -26,7 +28,7 @@ public static class LauncherIOInputs { public boolean hoodAngleAtGoal = false; public boolean turretAngleAtGoal = false; - public double flyWheelSpeedError = 0.0; + public AngularVelocity flyWheelSpeedError = RPM.of(0.0); public double hoodAngleError = 0.0; public double turretAngleError = 0.0; @@ -43,11 +45,11 @@ public default void updateInputs(LauncherIOInputs inputs) {} public void runShooter(double speed); + public void setFlyWheelVelocity(AngularVelocity speed); + public void setHoodAngle(Angle angle); public void setTurretRotation(Angle angle); - public void trackTarget(); - public default void updateSimulation() {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java index 3af37c5f..4189662d 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/LauncherIOReal.java @@ -12,6 +12,7 @@ import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.units.measure.Angle; +import edu.wpi.first.units.measure.AngularVelocity; import frc.robot.rebuilt.Constants; import frc.robot.rebuilt.commands.LauncherCommands; import java.util.Map; @@ -23,49 +24,55 @@ public class LauncherIOReal implements LauncherIO { protected Map devices; - private Pivot Turret; - private Arm Hood; + private Pivot turret; + private Arm hood; private FlyWheel flyWheel; public LauncherIOReal(Map devices) { this.devices = devices; - Turret = (Pivot) devices.get("turret"); - Hood = (Arm) devices.get("hood"); + turret = (Pivot) devices.get("turret"); + hood = (Arm) devices.get("hood"); flyWheel = (FlyWheel) devices.get("flywheel"); } @Override public void updateInputs(LauncherIOInputs inputs) { + ShotCalculator.ShootingParameters params = ShotCalculator.getInstance().getParameters(); + if (params != null && params.isValid()) { + // TODO: Use parameters to set turret, hood and flywheel desired values + } + inputs.flyWheelSpeedDesired = flyWheel .getMotorController() .getMechanismSetpointVelocity() - .map(it -> it.in(RPM)) - .orElse(0.0); + .map(it -> it) + .orElse(RPM.of(0.0)); inputs.hoodAngleDesired = - Hood.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); + hood.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); inputs.turretAngleDesired = - Turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); + turret.getMotorController().getMechanismPositionSetpoint().orElse(Degrees.of(0.0)); - inputs.flyWheelSpeedActual = flyWheel.getSpeed().in(RPM); - inputs.hoodAngleActual = Hood.getAngle(); - inputs.turretAngleActual = Turret.getAngle(); + inputs.flyWheelSpeedActual = flyWheel.getSpeed(); + inputs.hoodAngleActual = hood.getAngle(); + inputs.turretAngleActual = turret.getAngle(); - inputs.flyWheelSpeedError = inputs.flyWheelSpeedActual - inputs.flyWheelSpeedDesired; + inputs.flyWheelSpeedError = inputs.flyWheelSpeedActual.minus(inputs.flyWheelSpeedDesired); inputs.hoodAngleError = inputs.hoodAngleActual.minus(inputs.hoodAngleDesired).in(Degrees); inputs.turretAngleError = inputs.turretAngleActual.minus(inputs.turretAngleDesired).in(Degrees); inputs.flyWheelSpeedAtGoal = - Math.abs(inputs.flyWheelSpeedError) <= Constants.LauncherConstants.SHOOTER_TOLERANCE_RPM; + Math.abs(inputs.flyWheelSpeedError.in(RPM)) + <= Constants.LauncherConstants.SHOOTER_TOLERANCE_RPM; inputs.flyWheelSpeedAtGoal = Math.abs(inputs.hoodAngleError) <= Constants.LauncherConstants.HOOD_ANGLE_TOLERANCE_DEGREES; inputs.turretAngleAtGoal = Math.abs(inputs.turretAngleError) <= Constants.LauncherConstants.TURRET_ANGLE_TOLERANCE_DEGREES; - inputs.hoodVelocity = Hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); + inputs.hoodVelocity = hood.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); inputs.turretVelocity = - Turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); + turret.getMotorController().getMechanismVelocity().in(Degrees.per(Second)); inputs.flyWheelMotorOutput = flyWheel.getMotor().getStatorCurrent().in(Amps); inputs.robotToTarget = LauncherCommands.getRobotToTarget(); @@ -77,21 +84,15 @@ public void runShooter(double speed) { flyWheel.getMotor().setDutyCycle(speed); } - public void setUpperSpeed(double speed) { - flyWheel.getMotor().setDutyCycle(speed); - } - - public void setLowerSpeed(double speed) { - flyWheel.getMotor().setDutyCycle(speed); + public void setFlyWheelVelocity(AngularVelocity speed) { + flyWheel.getMotor().setVelocity(speed); } public void setHoodAngle(Angle angle) { - Hood.getMotorController().setPosition(angle); + hood.getMotorController().setPosition(angle); } public void setTurretRotation(Angle angle) { - Turret.getMotorController().setPosition(angle); + turret.getMotorController().setPosition(angle); } - - public void trackTarget() {} // Placeholder } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Launcher/ShotCalculator.java b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/ShotCalculator.java new file mode 100644 index 00000000..dd1eedc1 --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/subsystems/Launcher/ShotCalculator.java @@ -0,0 +1,187 @@ +// Copyright (c) 2025-2026 Littleton Robotics +// http://github.com/Mechanical-Advantage +// +// Use of this source code is governed by an MIT-style +// license that can be found in the LICENSE file at +// the root directory of this project. + +package frc.robot.rebuilt.subsystems.Launcher; + +import org.frc5010.common.constants.Constants; +import org.frc5010.common.utils.geometry.AllianceFlipUtil; +import org.frc5010.common.utils.geometry.GeomUtil; +import org.littletonrobotics.junction.Logger; + +import edu.wpi.first.math.filter.LinearFilter; +import edu.wpi.first.math.geometry.Pose2d; +import edu.wpi.first.math.geometry.Rotation2d; +import edu.wpi.first.math.geometry.Translation2d; +import edu.wpi.first.math.geometry.Twist2d; +import edu.wpi.first.math.interpolation.InterpolatingDoubleTreeMap; +import edu.wpi.first.math.interpolation.InterpolatingTreeMap; +import edu.wpi.first.math.interpolation.InverseInterpolator; +import edu.wpi.first.math.kinematics.ChassisSpeeds; +import frc.robot.rebuilt.FieldConstants; +import frc.robot.rebuilt.Rebuilt; +import lombok.experimental.ExtensionMethod; + +@ExtensionMethod({GeomUtil.class}) +public class ShotCalculator { + private static ShotCalculator instance; + + private final LinearFilter turretAngleFilter = + LinearFilter.movingAverage((int) (0.1 / Constants.loopPeriodSecs)); + private final LinearFilter hoodAngleFilter = + LinearFilter.movingAverage((int) (0.1 / Constants.loopPeriodSecs)); + + private Rotation2d lastTurretAngle; + private double lastHoodAngle; + private Rotation2d turretAngle; + private double hoodAngle = Double.NaN; + private double turretVelocity; + private double hoodVelocity; + + public static ShotCalculator getInstance() { + if (instance == null) instance = new ShotCalculator(); + return instance; + } + + public record ShootingParameters( + boolean isValid, + Rotation2d turretAngle, + double turretVelocity, + double hoodAngle, + double hoodVelocity, + double flywheelSpeed) {} + + // Cache parameters + private ShootingParameters latestParameters = null; + + private static double minDistance; + private static double maxDistance; + private static double phaseDelay; + private static final InterpolatingTreeMap shotHoodAngleMap = + new InterpolatingTreeMap<>(InverseInterpolator.forDouble(), Rotation2d::interpolate); + private static final InterpolatingDoubleTreeMap shotFlywheelSpeedMap = + new InterpolatingDoubleTreeMap(); + private static final InterpolatingDoubleTreeMap timeOfFlightMap = + new InterpolatingDoubleTreeMap(); + + static { + minDistance = 1.34; + maxDistance = 5.60; + phaseDelay = 0.03; + + // TODO: Populate these maps with real data + shotHoodAngleMap.put(1.34, Rotation2d.fromDegrees(19.0)); + shotHoodAngleMap.put(1.78, Rotation2d.fromDegrees(19.0)); + shotHoodAngleMap.put(2.17, Rotation2d.fromDegrees(24.0)); + shotHoodAngleMap.put(2.81, Rotation2d.fromDegrees(27.0)); + shotHoodAngleMap.put(3.82, Rotation2d.fromDegrees(29.0)); + shotHoodAngleMap.put(4.09, Rotation2d.fromDegrees(30.0)); + shotHoodAngleMap.put(4.40, Rotation2d.fromDegrees(31.0)); + shotHoodAngleMap.put(4.77, Rotation2d.fromDegrees(32.0)); + shotHoodAngleMap.put(5.57, Rotation2d.fromDegrees(32.0)); + shotHoodAngleMap.put(5.60, Rotation2d.fromDegrees(35.0)); + + shotFlywheelSpeedMap.put(1.34, 210.0); + shotFlywheelSpeedMap.put(1.78, 220.0); + shotFlywheelSpeedMap.put(2.17, 220.0); + shotFlywheelSpeedMap.put(2.81, 230.0); + shotFlywheelSpeedMap.put(3.82, 250.0); + shotFlywheelSpeedMap.put(4.09, 255.0); + shotFlywheelSpeedMap.put(4.40, 260.0); + shotFlywheelSpeedMap.put(4.77, 265.0); + shotFlywheelSpeedMap.put(5.57, 275.0); + shotFlywheelSpeedMap.put(5.60, 290.0); + + timeOfFlightMap.put(5.68, 1.16); + timeOfFlightMap.put(4.55, 1.12); + timeOfFlightMap.put(3.15, 1.11); + timeOfFlightMap.put(1.88, 1.09); + timeOfFlightMap.put(1.38, 0.90); + } + + public ShootingParameters getParameters() { + if (latestParameters != null) { + return latestParameters; + } + + // Calculate estimated pose while accounting for phase delay + Pose2d estimatedPose = Rebuilt.drivetrain.getPoseEstimator().getCurrentPose(); + ChassisSpeeds robotRelativeVelocity = Rebuilt.drivetrain.getRobotVelocity(); + estimatedPose = + estimatedPose.exp( + new Twist2d( + robotRelativeVelocity.vxMetersPerSecond * phaseDelay, + robotRelativeVelocity.vyMetersPerSecond * phaseDelay, + robotRelativeVelocity.omegaRadiansPerSecond * phaseDelay)); + + // Calculate distance from turret to target + Translation2d target = + AllianceFlipUtil.apply(FieldConstants.Hub.topCenterPoint.toTranslation2d()); + Pose2d turretPosition = estimatedPose.transformBy(Launcher.robotToTurret.toTransform2d()); + double turretToTargetDistance = target.getDistance(turretPosition.getTranslation()); + + // Calculate field relative turret velocity + ChassisSpeeds robotVelocity = Rebuilt.drivetrain.getFieldVelocity(); + double robotAngle = estimatedPose.getRotation().getRadians(); + double turretVelocityX = + robotVelocity.vxMetersPerSecond + + robotVelocity.omegaRadiansPerSecond + * (Launcher.robotToTurret.getY() * Math.cos(robotAngle) + - Launcher.robotToTurret.getX() * Math.sin(robotAngle)); + double turretVelocityY = + robotVelocity.vyMetersPerSecond + + robotVelocity.omegaRadiansPerSecond + * (Launcher.robotToTurret.getX() * Math.cos(robotAngle) + - Launcher.robotToTurret.getY() * Math.sin(robotAngle)); + + // Account for imparted velocity by robot (turret) to offset + double timeOfFlight; + Pose2d lookaheadPose = turretPosition; + double lookaheadTurretToTargetDistance = turretToTargetDistance; + for (int i = 0; i < 20; i++) { + timeOfFlight = timeOfFlightMap.get(lookaheadTurretToTargetDistance); + double offsetX = turretVelocityX * timeOfFlight; + double offsetY = turretVelocityY * timeOfFlight; + lookaheadPose = + new Pose2d( + turretPosition.getTranslation().plus(new Translation2d(offsetX, offsetY)), + turretPosition.getRotation()); + lookaheadTurretToTargetDistance = target.getDistance(lookaheadPose.getTranslation()); + } + + // Calculate parameters accounted for imparted velocity + turretAngle = target.minus(lookaheadPose.getTranslation()).getAngle(); + hoodAngle = shotHoodAngleMap.get(lookaheadTurretToTargetDistance).getRadians(); + if (lastTurretAngle == null) lastTurretAngle = turretAngle; + if (Double.isNaN(lastHoodAngle)) lastHoodAngle = hoodAngle; + turretVelocity = + turretAngleFilter.calculate( + turretAngle.minus(lastTurretAngle).getRadians() / Constants.loopPeriodSecs); + hoodVelocity = + hoodAngleFilter.calculate((hoodAngle - lastHoodAngle) / Constants.loopPeriodSecs); + lastTurretAngle = turretAngle; + lastHoodAngle = hoodAngle; + latestParameters = + new ShootingParameters( + lookaheadTurretToTargetDistance >= minDistance + && lookaheadTurretToTargetDistance <= maxDistance, + turretAngle, + turretVelocity, + hoodAngle, + hoodVelocity, + shotFlywheelSpeedMap.get(lookaheadTurretToTargetDistance)); + + // Log calculated values + Logger.recordOutput("ShotCalculator/LookaheadPose", lookaheadPose); + Logger.recordOutput("ShotCalculator/TurretToTargetDistance", lookaheadTurretToTargetDistance); + + return latestParameters; + } + + public void clearShootingParameters() { + latestParameters = null; + } +} From 42c67bf407b44cc50a1ac461799929d73cdd1ad6 Mon Sep 17 00:00:00 2001 From: "Adam K." <73131727+Adam-Kolt@users.noreply.github.com> Date: Sun, 1 Feb 2026 19:13:40 -0500 Subject: [PATCH 078/371] Copy in HubTracker utility for alliance shift tracking from team 5000 Added HubTracker, a utility class for tracking match shifts, alliance activity, and auto winner status in FRC matches. Provides methods to determine the current and next shift, time remaining, and whether the hub is active for a given alliance or shift. --- .../java/frc/robot/rebuilt/HubTracker.java | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 src/main/java/frc/robot/rebuilt/HubTracker.java diff --git a/src/main/java/frc/robot/rebuilt/HubTracker.java b/src/main/java/frc/robot/rebuilt/HubTracker.java new file mode 100644 index 00000000..1010b90b --- /dev/null +++ b/src/main/java/frc/robot/rebuilt/HubTracker.java @@ -0,0 +1,185 @@ +package frc.robot.rebuilt; + +import static edu.wpi.first.units.Units.Seconds; + +import edu.wpi.first.units.measure.Time; +import edu.wpi.first.wpilibj.DriverStation; +import edu.wpi.first.wpilibj.DriverStation.Alliance; +import java.util.Optional; + +public class HubTracker { + /** + * Returns an {@link Optional} containing the current {@link Shift}. + * Will return {@link Optional#empty()} if disabled or in between auto and teleop. + */ + public static Optional getCurrentShift() { + double matchTime = getMatchTime(); + if (matchTime < 0) return Optional.empty(); + + for (Shift shift : Shift.values()) { + if (matchTime < shift.endTime) { + return Optional.of(shift); + } + } + return Optional.empty(); + } + + /** + * Returns an {@link Optional} containing the current {@link Time} remaining in the current shift. + * Will return {@link Optional#empty()} if disabled or in between auto and teleop. + */ + public static Optional

Values:

+ *
    + *
  • {@link Shift#AUTO}
  • (0-20 sec) + *
  • {@link Shift#TRANSITION}
  • (20-30 sec) + *
  • {@link Shift#SHIFT_1}
  • (30-55 sec) + *
  • {@link Shift#SHIFT_2}
  • (55-80 sec) + *
  • {@link Shift#SHIFT_3}
  • (80-105 sec) + *
  • {@link Shift#SHIFT_4}
  • (105-130 sec) + *
  • {@link Shift#ENDGAME}
  • (130-160 sec) + *
+ */ + public enum Shift { + AUTO(0, 20, ActiveType.BOTH), + TRANSITION(20, 30, ActiveType.BOTH), + SHIFT_1(30, 55, ActiveType.AUTO_LOSER), + SHIFT_2(55, 80, ActiveType.AUTO_WINNER), + SHIFT_3(80, 105, ActiveType.AUTO_LOSER), + SHIFT_4(105, 130, ActiveType.AUTO_WINNER), + ENDGAME(130, 160, ActiveType.BOTH); + + final int startTime; + final int endTime; + final ActiveType activeType; + + private Shift(int startTime, int endTime, ActiveType activeType) { + this.startTime = startTime; + this.endTime = endTime; + this.activeType = activeType; + } + } + + private enum ActiveType { + BOTH, + AUTO_WINNER, + AUTO_LOSER + } +} From 09c6bd6630a1657adcc474596de064471c545778 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 2 Feb 2026 16:33:23 -0500 Subject: [PATCH 079/371] move indexer function to io --- .../frc/robot/rebuilt/subsystems/Indexer/Indexer.java | 7 ++----- .../robot/rebuilt/subsystems/Indexer/IndexerIO.java | 4 ++++ .../rebuilt/subsystems/Indexer/IndexerIOReal.java | 11 +++++++++++ 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index afb64840..765b5592 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -8,15 +8,12 @@ import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; import org.frc5010.common.arch.GenericSubsystem; -import org.frc5010.common.motors.function.PercentControlMotor; import org.frc5010.common.sensors.Controller; import org.littletonrobotics.junction.Logger; public class Indexer extends GenericSubsystem { - private PercentControlMotor Spindexer; private final IndexerIO io; private final IndexerIOInputsAutoLogged inputs = new IndexerIOInputsAutoLogged(); - private PercentControlMotor Feeder; /** Creates a new Index. */ public Indexer() { @@ -30,11 +27,11 @@ public Indexer() { } public void RunSpindexer(double speed) { - Spindexer.set(speed); + io.RunSpindexer(speed); } public void RunFeeder(double speed) { - Feeder.set(speed); + io.RunFeeder(speed); } public void ConfigController(Controller controller) { diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java index 887b3943..046eff45 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java @@ -10,5 +10,9 @@ public static class IndexerIOInputs { public double transferBackSpeed = 0; } + public void RunSpindexer(double speed); + + public void RunFeeder(double speed); + public default void updateInputs(IndexerIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index e536f5f3..5de69d7a 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -1,14 +1,25 @@ package frc.robot.rebuilt.subsystems.Indexer; import java.util.Map; +import org.frc5010.common.motors.function.PercentControlMotor; public class IndexerIOReal implements IndexerIO { protected Map devices; + private PercentControlMotor Spindexer; + private PercentControlMotor Feeder; public IndexerIOReal(Map devices) { this.devices = devices; } + public void RunFeeder(double speed) { + Spindexer.set(speed); + } + + public void RunSpindexer(double speed) { + Feeder.set(speed); + } + @Override public void updateInputs(IndexerIOInputs inputs) { // TODO: Add update to input values From aad7990684f21766f7fe4a7d59283f4b2b4d8a11 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 2 Feb 2026 16:50:58 -0500 Subject: [PATCH 080/371] outtaking state --- .../rebuilt/commands/IntakeCommands.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java index b66c739a..f6588ee2 100644 --- a/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java +++ b/src/main/java/frc/robot/rebuilt/commands/IntakeCommands.java @@ -20,8 +20,8 @@ public class IntakeCommands { private static enum IntakeState { RETRACTED, RETRACTING, - INTAKING - // TODO : Add OUTTAKING + INTAKING, + OUTTAKING } @AutoLogOutput(key = "IntakeCommands/RequestedIntakeState") @@ -33,7 +33,7 @@ public IntakeCommands(Map subsystems) { } State retracted = intakeStateMachine.addState("retracted", retractedCommand()); - + State outtaking = intakeStateMachine.addState("outtaking", outtakingCommand()); State retracting = intakeStateMachine.addState("retracting", retractingCommand()); State intaking = intakeStateMachine.addState("intaking", intakingCommand()); @@ -43,16 +43,21 @@ public void configureButtonBindings(Controller controller) { controller.setLeftTrigger(controller.createLeftTrigger()); Trigger leftTrigger = new Trigger(() -> controller.getLeftTrigger() > 0.25); - // TODO: This should be intaking not retracting - rightTrigger.onTrue(shouldRetracting()).onFalse(shouldRetracted()); - // TODO: Make left trigger do an outtaking state - + rightTrigger.onTrue(shouldIntaking()).onFalse(shouldRetracted()); + leftTrigger.onTrue(shouldOuttaking()).onFalse(shouldRetracted()); retracting.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); retracted.switchTo(intaking).when(() -> requestedState == IntakeState.INTAKING); intaking.switchTo(retracting).when(() -> requestedState == IntakeState.RETRACTING); retracting.switchTo(retracted).when(() -> intake.isRetracted()); } + public Command outtakingCommand() { + return Commands.print("OUTTAKING") + .andThen(() -> intake.RunSpintake(-25)) + .andThen(() -> intake.setPinionPosition(0)); + // assuming outtaking is just intaking but goes the other way + } + public Command intakingCommand() { return Commands.print("INTAKING") .andThen(() -> intake.RunSpintake(25)) @@ -71,6 +76,10 @@ public Command retractedCommand() { .andThen(() -> intake.setPinionPosition(0)); } + public Command shouldOuttaking() { + return Commands.runOnce(() -> requestedState = IntakeState.OUTTAKING); + } + public Command shouldIntaking() { return Commands.runOnce(() -> requestedState = IntakeState.INTAKING); } From 5c28212cf51f6a63f5247106b042b0b4b80170e9 Mon Sep 17 00:00:00 2001 From: 5010 Tiger Dynasty Date: Mon, 2 Feb 2026 17:18:07 -0500 Subject: [PATCH 081/371] transfer front and back --- .../robot/rebuilt/subsystems/Indexer/Indexer.java | 13 +++++++++---- .../rebuilt/subsystems/Indexer/IndexerIO.java | 4 +++- .../rebuilt/subsystems/Indexer/IndexerIOReal.java | 15 +++++++++++---- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java index 765b5592..4f55ec32 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/Indexer.java @@ -30,15 +30,19 @@ public void RunSpindexer(double speed) { io.RunSpindexer(speed); } - public void RunFeeder(double speed) { - io.RunFeeder(speed); + public void RunTransferBack(double speed) { + io.RunTransferBack(speed); + } + + public void RunTransferFront(double speed) { + io.RunTransferFront(speed); } public void ConfigController(Controller controller) { controller.createAButton().whileTrue(spindexerCommand(.25)); - controller.createBButton().whileTrue(feederCommand(.25)); + // controller.createBButton().whileTrue(feederCommand(.25)); } - + /* public Command feederCommand(double speed) { return Commands.run( () -> { @@ -49,6 +53,7 @@ public Command feederCommand(double speed) { RunFeeder(0); }); } + */ public Command spindexerCommand(double speed) { return Commands.run( diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java index 046eff45..4328d5ff 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIO.java @@ -12,7 +12,9 @@ public static class IndexerIOInputs { public void RunSpindexer(double speed); - public void RunFeeder(double speed); + public void RunTransferFront(double speed); + + public void RunTransferBack(double speed); public default void updateInputs(IndexerIOInputs inputs) {} } diff --git a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java index 5de69d7a..72e275e8 100644 --- a/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java +++ b/src/main/java/frc/robot/rebuilt/subsystems/Indexer/IndexerIOReal.java @@ -6,18 +6,25 @@ public class IndexerIOReal implements IndexerIO { protected Map devices; private PercentControlMotor Spindexer; - private PercentControlMotor Feeder; + private PercentControlMotor TransferFront, TransferBack; public IndexerIOReal(Map devices) { + Spindexer = (PercentControlMotor) devices.get("spindexer"); + TransferFront = (PercentControlMotor) devices.get("transfer_front"); + TransferBack = (PercentControlMotor) devices.get("transfer_back"); this.devices = devices; } - public void RunFeeder(double speed) { - Spindexer.set(speed); + public void RunTransferFront(double speed) { + TransferFront.set(speed); + } + + public void RunTransferBack(double speed) { + TransferBack.set(speed); } public void RunSpindexer(double speed) { - Feeder.set(speed); + Spindexer.set(speed); } @Override From d3bc2eb344023c3cfc4323bd2ad8822c9a09a6a9 Mon Sep 17 00:00:00 2001 From: Adamtheboss9 Date: Mon, 2 Feb 2026 17:29:19 -0500 Subject: [PATCH 082/371] Added Launcher Calculations --- src/main/java/frc/robot/BuildConstants.java | 14 +- .../java/frc/robot/rebuilt/HubTracker.java | 341 +++++++++--------- .../rebuilt/commands/LauncherCommands.java | 19 +- .../rebuilt/subsystems/Launcher/Launcher.java | 31 +- .../subsystems/Launcher/LauncherIO.java | 5 + .../subsystems/Launcher/LauncherIOReal.java | 4 + .../subsystems/Launcher/ShotCalculator.java | 9 +- 7 files changed, 222 insertions(+), 201 deletions(-) diff --git a/src/main/java/frc/robot/BuildConstants.java b/src/main/java/frc/robot/BuildConstants.java index 9cfeaa69..8dd0d032 100644 --- a/src/main/java/frc/robot/BuildConstants.java +++ b/src/main/java/frc/robot/BuildConstants.java @@ -3,14 +3,14 @@ /** Automatically generated file containing build version information. */ public final class BuildConstants { public static final String MAVEN_GROUP = ""; - public static final String MAVEN_NAME = "rebuilt2026"; + public static final String MAVEN_NAME = "Rebuilt2026"; public static final String VERSION = "unspecified"; - public static final int GIT_REVISION = 81; - public static final String GIT_SHA = "e5bd64a909847009ebae0db75c2eb2a57ad49316"; - public static final String GIT_DATE = "2026-01-26 17:57:48 EST"; - public static final String GIT_BRANCH = "main"; - public static final String BUILD_DATE = "2026-02-01 17:00:24 EST"; - public static final long BUILD_UNIX_TIME = 1769983224737L; + public static final int GIT_REVISION = 211; + public static final String GIT_SHA = "42c67bf407b44cc50a1ac461799929d73cdd1ad6"; + public static final String GIT_DATE = "2026-02-01 19:13:40 EST"; + public static final String GIT_BRANCH = "Rebuilt"; + public static final String BUILD_DATE = "2026-02-02 17:07:17 EST"; + public static final long BUILD_UNIX_TIME = 1770070037551L; public static final int DIRTY = 1; private BuildConstants() {} diff --git a/src/main/java/frc/robot/rebuilt/HubTracker.java b/src/main/java/frc/robot/rebuilt/HubTracker.java index 1010b90b..1ee56fd1 100644 --- a/src/main/java/frc/robot/rebuilt/HubTracker.java +++ b/src/main/java/frc/robot/rebuilt/HubTracker.java @@ -8,178 +8,185 @@ import java.util.Optional; public class HubTracker { - /** - * Returns an {@link Optional} containing the current {@link Shift}. - * Will return {@link Optional#empty()} if disabled or in between auto and teleop. - */ - public static Optional getCurrentShift() { - double matchTime = getMatchTime(); - if (matchTime < 0) return Optional.empty(); - - for (Shift shift : Shift.values()) { - if (matchTime < shift.endTime) { - return Optional.of(shift); - } - } - return Optional.empty(); - } - - /** - * Returns an {@link Optional} containing the current {@link Time} remaining in the current shift. - * Will return {@link Optional#empty()} if disabled or in between auto and teleop. - */ - public static Optional