From 8002dc08a426a7cec286a3f39aaf06dc7eedcd4d Mon Sep 17 00:00:00 2001 From: Ethan Porter Date: Mon, 11 May 2026 18:46:10 -0400 Subject: [PATCH 1/2] intake testing --- .../implementations/motor/MotorIOTalonFx.java | 2 + .../java/frc/robot/io/interfaces/MotorIO.java | 4 +- .../controls/combination/AutoControls.java | 2 - .../controls/combination/DriverControls.java | 20 ++- src/main/resources/red.properties | 51 ++----- src/main/resources/red/red-vision.properties | 133 ++++++++++-------- 6 files changed, 108 insertions(+), 104 deletions(-) diff --git a/src/main/java/frc/robot/io/implementations/motor/MotorIOTalonFx.java b/src/main/java/frc/robot/io/implementations/motor/MotorIOTalonFx.java index 14d5f8a..4e0904a 100644 --- a/src/main/java/frc/robot/io/implementations/motor/MotorIOTalonFx.java +++ b/src/main/java/frc/robot/io/implementations/motor/MotorIOTalonFx.java @@ -129,6 +129,8 @@ public void updateInputs(MotorIOInputs inputs) { inputs.isConnected = motorFx.isConnected(); inputs.statorCurrentAmps = motorFx.getStatorCurrent().getValueAsDouble(); + inputs.torqueCurrentAmps = motorFx.getTorqueCurrent().getValueAsDouble(); + inputs.motorStallCurrentAmps = motorFx.getMotorStallCurrent().getValueAsDouble(); super.updateInputs(inputs); } diff --git a/src/main/java/frc/robot/io/interfaces/MotorIO.java b/src/main/java/frc/robot/io/interfaces/MotorIO.java index 8560796..3401830 100644 --- a/src/main/java/frc/robot/io/interfaces/MotorIO.java +++ b/src/main/java/frc/robot/io/interfaces/MotorIO.java @@ -50,7 +50,9 @@ public class MotorIOInputs { public double positionMeters = 0.0; // the current position of the linear mechanism connected to the motor shaft (in // meters) - public double statorCurrentAmps = -1.0; + public double statorCurrentAmps = 0.0; + public double torqueCurrentAmps = 0.0; + public double motorStallCurrentAmps = 0.0; public boolean isConnected = false; diff --git a/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java b/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java index d2bda90..bc0ac10 100644 --- a/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java +++ b/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java @@ -56,7 +56,6 @@ public static AutoRoutineSettings getAutoRoutineSettings(Properties properties) } } - private static Drive drive = null; @AutoLogOutput private static Pose2d pose = new Pose2d(); public static void registerNamedCommands( @@ -137,7 +136,6 @@ public static void registerNamedCommands( stopConveyor.asProxy().withTimeout(0.25), stopIndexer.asProxy().withTimeout(0.25)); - AutoControls.drive = drive; SmartDashboard.putNumber("Auto/rad", 2.05); PathConstraints constraints = new PathConstraints(1.0, 1.0, 2 * Math.PI, 4 * Math.PI); diff --git a/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java b/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java index a004bf4..bceef50 100644 --- a/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java +++ b/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java @@ -183,6 +183,13 @@ public static void setupMainController( new MotorRunVoltageCommand( (Motor) intakeArm, () -> settings.intakeArmWhileInakingVolts)); + Command intakeInDynamic = + new ParallelCommandGroup( + new FlywheelToVelocity(intake, () -> SmartDashboard.getNumber(((SubsystemBase) intake).getName() + "/Commands/Set Speed", settings.intakeRPM)), + new FlywheelToVelocity(conveyor, () -> settings.conveyorLaunchRPM), + new MotorRunVoltageCommand( + (Motor) intakeArm, () -> settings.intakeArmWhileInakingVolts)); + Command intakeOut = new ParallelCommandGroup( new FlywheelToVelocity(intake, () -> settings.intakeReverseRPM), @@ -263,13 +270,22 @@ public static void setupMainController( // SmartDashboard.putNumber( // "Controls/launchShooterRPM", settings.shooterAgainstHubLaunchRPM))); - // intake + // // intake uncomment once intake RPM is set. + // controller + // .leftTrigger() + // .whileTrue(intakeIn) + // .onFalse(stopIntake) + // .onFalse(stopConveyor) + // .onFalse(stopIntakeArm); + + // comment once intake RPM is set. controller .leftTrigger() - .whileTrue(intakeIn) + .whileTrue(intakeInDynamic) .onFalse(stopIntake) .onFalse(stopConveyor) .onFalse(stopIntakeArm); + controller.leftBumper().whileTrue(intakeOut).onFalse(stopIntake).onFalse(stopConveyor); // deployer diff --git a/src/main/resources/red.properties b/src/main/resources/red.properties index ab795da..53b8bfa 100644 --- a/src/main/resources/red.properties +++ b/src/main/resources/red.properties @@ -3,26 +3,6 @@ auto.intakeDepotTimeoutSeconds=3 auto.intakeOutpostTimeoutSeconds=3 auto.launchOneFuelSeconds=0.2 auto.launchOneTimeoutSeconds=0.4 -backLeft.cameraType=photon -backLeft.robotToCamera.pitchDegrees=-7.5 -backLeft.robotToCamera.rollDegrees=0 -backLeft.robotToCamera.xMeters=-0.296269 -backLeft.robotToCamera.yMeters=0.332374 -backLeft.robotToCamera.yawDegrees=227 -backLeft.robotToCamera.zMeters=0.458225 -backLeft.settings.fps=30 -backLeft.settings.resHeight=600 -backLeft.settings.resWidth=800 -backRight.cameraType=photon -backRight.robotToCamera.pitchDegrees=-3.4 -backRight.robotToCamera.rollDegrees=0 -backRight.robotToCamera.xMeters=-0.332374 -backRight.robotToCamera.yMeters=-0.296269 -backRight.robotToCamera.yawDegrees=-45 -backRight.robotToCamera.zMeters=0.458225 -backRight.settings.fps=30 -backRight.settings.resHeight=600 -backRight.settings.resWidth=800 conveyorFlywheel.IOSettings.drumRadiusMeters=1.0 conveyorFlywheel.IOSettings.gearing=5.0 conveyorFlywheel.IOSettings.inverted=true @@ -175,26 +155,6 @@ driverControls.shooterDepotLaunchRPM=2300.0 driverControls.shooterOutpostLaunchRPM=3450.0 driverControls.shooterPassRPM=5500.0 driverControls.shooterTrenchLaunchRPM=3200.0 -frontLeft.cameraType=photon -frontLeft.robotToCamera.pitchDegrees=-3.5 -frontLeft.robotToCamera.rollDegrees=0 -frontLeft.robotToCamera.xMeters=0.332349 -frontLeft.robotToCamera.yMeters=0.296255 -frontLeft.robotToCamera.yawDegrees=133 -frontLeft.robotToCamera.zMeters=0.467895 -frontLeft.settings.fps=0 -frontLeft.settings.resHeight=0 -frontLeft.settings.resWidth=0 -frontRight.cameraType=photon -frontRight.robotToCamera.pitchDegrees=-7.5 -frontRight.robotToCamera.rollDegrees=0 -frontRight.robotToCamera.xMeters=0.23906 -frontRight.robotToCamera.yMeters=-0.332271 -frontRight.robotToCamera.yawDegrees=41 -frontRight.robotToCamera.zMeters=0.467981 -frontRight.settings.fps=30 -frontRight.settings.resHeight=600 -frontRight.settings.resWidth=800 indexerFlywheel.IOSettings.drumRadiusMeters=1.0 indexerFlywheel.IOSettings.gearing=5.0 indexerFlywheel.IOSettings.inverted=false @@ -280,6 +240,16 @@ intakeFlywheel.talonFXSettings.statorCurrentLimitAmps=80.0 intakeFlywheel.talonFXSettings.supplyCurrentLimitAmps=40.0 intakeFlywheel.talonFXSettings.supplyCurrentLowerLimitAmps=30.0 intakeFlywheel.talonFXSettings.supplyCurrentLowerTimeSeconds=1.00 +mainCamera.cameraType=photon +mainCamera.robotToCamera.pitchDegrees=-7.5 +mainCamera.robotToCamera.rollDegrees=0 +mainCamera.robotToCamera.xMeters=0.23906 +mainCamera.robotToCamera.yMeters=-0.332271 +mainCamera.robotToCamera.yawDegrees=41 +mainCamera.robotToCamera.zMeters=0.467981 +mainCamera.settings.fps=30 +mainCamera.settings.resHeight=600 +mainCamera.settings.resWidth=800 robot.drive.maxAngularRateRotationsPerSecond=0.75 robot.drive.maxSpeedMetersPerSecond=3 robot.drive=ctre @@ -311,7 +281,6 @@ shooterFlywheel.talonFXSettings.supplyCurrentLimitAmps=80.0 shooterFlywheel.talonFXSettings.supplyCurrentLowerLimitAmps=30.0 shooterFlywheel.talonFXSettings.supplyCurrentLowerTimeSeconds=1.00 vision.addDrivetrain=true -vision.cameras=backLeft, backRight, frontLeft, frontRight vision.fieldlayout=k2026RebuiltAndymark vision.settings.maximumMultiTagDistanceMeters=3.9 vision.settings.maximumSingleTagDistanceMeters=3.5 diff --git a/src/main/resources/red/red-vision.properties b/src/main/resources/red/red-vision.properties index c9540fc..3cf3993 100644 --- a/src/main/resources/red/red-vision.properties +++ b/src/main/resources/red/red-vision.properties @@ -6,61 +6,78 @@ vision.settings.maximumSingleTagDistanceMeters = 3.5 vision.settings.maximumMultiTagDistanceMeters = 3.9 vision.settings.visionLoggingDebug = true # name of cameras -vision.cameras = backLeft, backRight, frontLeft, frontRight -# front rightp -frontRight.cameraType = photon - -frontRight.robotToCamera.xMeters = 0.23906 -frontRight.robotToCamera.yMeters =-0.332271 -frontRight.robotToCamera.zMeters = 0.467981 -frontRight.robotToCamera.rollDegrees = 0 -frontRight.robotToCamera.pitchDegrees =-7.5 -frontRight.robotToCamera.yawDegrees = 41 - -frontRight.settings.fps = 30 -frontRight.settings.resWidth = 800 -frontRight.settings.resHeight = 600 - -# front left -frontLeft.cameraType = photon - -frontLeft.robotToCamera.xMeters = 0.332349 -frontLeft.robotToCamera.yMeters = 0.296255 -frontLeft.robotToCamera.zMeters = 0.467895 - -frontLeft.robotToCamera.rollDegrees = 0 -frontLeft.robotToCamera.pitchDegrees = -3.5 -frontLeft.robotToCamera.yawDegrees = 133 - -frontLeft.settings.fps = 0 -frontLeft.settings.resWidth = 0 -frontLeft.settings.resHeight = 0 - - -# back right -backRight.cameraType = photon - -backRight.robotToCamera.xMeters = -0.332374 -backRight.robotToCamera.yMeters = -0.296269 -backRight.robotToCamera.zMeters = 0.458225 -backRight.robotToCamera.rollDegrees = 0 -backRight.robotToCamera.pitchDegrees = -3.4 -backRight.robotToCamera.yawDegrees = -45 - -backRight.settings.fps = 30 -backRight.settings.resWidth = 800 -backRight.settings.resHeight = 600 - -# back left -backLeft.cameraType = photon - -backLeft.robotToCamera.xMeters = -0.296269 -backLeft.robotToCamera.yMeters = 0.332374 -backLeft.robotToCamera.zMeters = 0.458225 -backLeft.robotToCamera.rollDegrees = 0 -backLeft.robotToCamera.pitchDegrees = -7.5 -backLeft.robotToCamera.yawDegrees = 227 - -backLeft.settings.fps = 30 -backLeft.settings.resWidth = 800 -backLeft.settings.resHeight = 600 \ No newline at end of file +#mainCamera is the camera that is backing backwards on the right side of the robot (reminder the front is the side with the intake) +# vision.cameras = mainCamera + +mainCamera.cameraType = photon + +# need to gather +mainCamera.robotToCamera.xMeters = 0.23906 +mainCamera.robotToCamera.yMeters =-0.332271 +mainCamera.robotToCamera.zMeters = 0.467981 +mainCamera.robotToCamera.rollDegrees = 0 +mainCamera.robotToCamera.pitchDegrees =-7.5 +mainCamera.robotToCamera.yawDegrees = 41 + +#for sim +mainCamera.settings.fps = 30 +mainCamera.settings.resWidth = 800 +mainCamera.settings.resHeight = 600 + +# front right +# frontRight.cameraType = photon + +# frontRight.robotToCamera.xMeters = 0.23906 +# frontRight.robotToCamera.yMeters =-0.332271 +# frontRight.robotToCamera.zMeters = 0.467981 +# frontRight.robotToCamera.rollDegrees = 0 +# frontRight.robotToCamera.pitchDegrees =-7.5 +# frontRight.robotToCamera.yawDegrees = 41 + +# frontRight.settings.fps = 30 +# frontRight.settings.resWidth = 800 +# frontRight.settings.resHeight = 600 + +# # front left +# frontLeft.cameraType = photon + +# frontLeft.robotToCamera.xMeters = 0.332349 +# frontLeft.robotToCamera.yMeters = 0.296255 +# frontLeft.robotToCamera.zMeters = 0.467895 + +# frontLeft.robotToCamera.rollDegrees = 0 +# frontLeft.robotToCamera.pitchDegrees = -3.5 +# frontLeft.robotToCamera.yawDegrees = 133 + +# frontLeft.settings.fps = 0 +# frontLeft.settings.resWidth = 0 +# frontLeft.settings.resHeight = 0 + + +# # back right +# backRight.cameraType = photon + +# backRight.robotToCamera.xMeters = -0.332374 +# backRight.robotToCamera.yMeters = -0.296269 +# backRight.robotToCamera.zMeters = 0.458225 +# backRight.robotToCamera.rollDegrees = 0 +# backRight.robotToCamera.pitchDegrees = -3.4 +# backRight.robotToCamera.yawDegrees = -45 + +# backRight.settings.fps = 30 +# backRight.settings.resWidth = 800 +# backRight.settings.resHeight = 600 + +# # back left +# backLeft.cameraType = photon + +# backLeft.robotToCamera.xMeters = -0.296269 +# backLeft.robotToCamera.yMeters = 0.332374 +# backLeft.robotToCamera.zMeters = 0.458225 +# backLeft.robotToCamera.rollDegrees = 0 +# backLeft.robotToCamera.pitchDegrees = -7.5 +# backLeft.robotToCamera.yawDegrees = 227 + +# backLeft.settings.fps = 30 +# backLeft.settings.resWidth = 800 +# backLeft.settings.resHeight = 600 \ No newline at end of file From b6b4d4c811a6584e7dd6b4ae8f793b79c50c7d7d Mon Sep 17 00:00:00 2001 From: Ethan Porter Date: Sun, 31 May 2026 13:29:19 -0400 Subject: [PATCH 2/2] changes for and during states --- ...ub + score 8 + depot + center + score.auto | 66 ++++++++-- ...trench score + neutral + trench score.auto | 107 +++++++-------- ...rench + neutral + trench score .07mps.auto | 68 ---------- ...ench + neutral + trench score 0.75mps.auto | 68 ---------- ...-left trench + neutral + trench score.auto | 16 +-- ...trench score + neutral + trench score.auto | 124 +++++++----------- ...nch + neutral + trench score 0.75 mps.auto | 62 --------- .../paths/red-center to depot.path | 12 +- .../paths/red-depot to center score.path | 8 +- .../paths/red-left trench to neutral.path | 2 +- .../paths/red-move back to score.path | 4 +- .../red-neutral to left trench score.path | 4 +- .../red-neutral to right trench score.path | 4 +- .../paths/red-right trench to neutral.path | 2 +- .../controls/combination/AutoControls.java | 9 +- .../controls/combination/DriverControls.java | 25 ++-- src/main/resources/red.properties | 24 ++-- .../red/red-driver-controls.properties | 12 +- src/main/resources/red/red-vision.properties | 12 +- 19 files changed, 219 insertions(+), 410 deletions(-) delete mode 100644 src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score .07mps.auto delete mode 100644 src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score 0.75mps.auto delete mode 100644 src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score 0.75 mps.auto diff --git a/src/main/deploy/pathplanner/autos/red-center hub + score 8 + depot + center + score.auto b/src/main/deploy/pathplanner/autos/red-center hub + score 8 + depot + center + score.auto index 91485ef..358fede 100644 --- a/src/main/deploy/pathplanner/autos/red-center hub + score 8 + depot + center + score.auto +++ b/src/main/deploy/pathplanner/autos/red-center hub + score 8 + depot + center + score.auto @@ -11,39 +11,71 @@ } }, { - "type": "named", + "type": "race", "data": { - "name": "Launch From Center Hub Path" + "commands": [ + { + "type": "wait", + "data": { + "waitTime": 2.0 + } + }, + { + "type": "named", + "data": { + "name": "Launch From Center Hub Path" + } + } + ] } }, { "type": "wait", "data": { - "waitTime": 3.0 + "waitTime": 2.0 } }, { "type": "named", "data": { - "name": "Stop Launching" + "name": "Stop Conveyor" } }, { "type": "named", "data": { - "name": "Stop Launching" + "name": "Stop Indexer" } }, { "type": "named", "data": { - "name": "Stop Launching" + "name": "Stop Shooter" } }, { - "type": "path", + "type": "named", + "data": { + "name": "Stop Shooter" + } + }, + { + "type": "parallel", "data": { - "pathName": "red-center to depot" + "commands": [ + { + "type": "path", + "data": { + "pathName": "red-center to depot" + } + }, + { + "type": "named", + "data": { + "name": "Stop Shooting Parallel" + } + } + ] } }, { @@ -63,6 +95,24 @@ "data": { "name": "Launch From Center Hub Path" } + }, + { + "type": "wait", + "data": { + "waitTime": 2.0 + } + }, + { + "type": "named", + "data": { + "name": "Deployer Up" + } + }, + { + "type": "named", + "data": { + "name": "Deployer Up" + } } ] } diff --git a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score + neutral + trench score.auto b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score + neutral + trench score.auto index fdff143..25c08cc 100644 --- a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score + neutral + trench score.auto +++ b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score + neutral + trench score.auto @@ -17,50 +17,13 @@ } }, { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "race", + "type": "parallel", "data": { "commands": [ { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Launch From Neutral Path" - } - }, - { - "type": "wait", - "data": { - "waitTime": 0.25 - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Spin Intake Flywheel" - } - } - ] - } - }, - { - "type": "wait", + "type": "named", "data": { - "waitTime": 2.0 + "name": "Launch From Neutral Path" } } ] @@ -69,7 +32,43 @@ { "type": "named", "data": { - "name": "Stop Intake Flywheel" + "name": "Stop Intake" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.25 + } + }, + { + "type": "named", + "data": { + "name": "Deployer Up" + } + }, + { + "type": "wait", + "data": { + "waitTime": 4.0 + } + }, + { + "type": "path", + "data": { + "pathName": "red-left trench score to neutral center " + } + }, + { + "type": "path", + "data": { + "pathName": "red-neutral center to left trench score" + } + }, + { + "type": "named", + "data": { + "name": "Stop Intake" } }, { @@ -79,40 +78,22 @@ { "type": "named", "data": { - "name": "Stop Launching" - } - }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "path", - "data": { - "pathName": "red-left trench score to neutral center " + "name": "Launch From Neutral Path" } } ] } }, { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "path", + "type": "wait", "data": { - "pathName": "red-neutral center to left trench score" + "waitTime": 0.25 } }, { "type": "named", "data": { - "name": "Launch From Neutral Path" + "name": "Deployer Up" } } ] diff --git a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score .07mps.auto b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score .07mps.auto deleted file mode 100644 index 6fee6ce..0000000 --- a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score .07mps.auto +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "red-left trench to neutral 0.75 mps" - } - }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "path", - "data": { - "pathName": "red-neutral to left trench score 0.75 mps" - } - }, - { - "type": "parallel", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Launch From Neutral Path" - } - } - ] - } - }, - { - "type": "wait", - "data": { - "waitTime": 0.25 - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Spin Intake Flywheel" - } - } - ] - } - }, - "resetOdom": true, - "folder": "red", - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score 0.75mps.auto b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score 0.75mps.auto deleted file mode 100644 index c7a76c7..0000000 --- a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score 0.75mps.auto +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "red-left trench to neutral 0.75 mps" - } - }, - { - "type": "path", - "data": { - "pathName": "red-neutral to left trench score 0.75 mps" - } - }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "parallel", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Launch From Neutral Path" - } - } - ] - } - }, - { - "type": "wait", - "data": { - "waitTime": 0.25 - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Spin Intake Flywheel" - } - } - ] - } - }, - "resetOdom": true, - "folder": "red", - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score.auto b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score.auto index 4b8d4f1..087fec5 100644 --- a/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score.auto +++ b/src/main/deploy/pathplanner/autos/red-left trench + neutral + trench score.auto @@ -16,12 +16,6 @@ "pathName": "red-neutral to left trench score" } }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, { "type": "parallel", "data": { @@ -36,15 +30,15 @@ } }, { - "type": "wait", + "type": "named", "data": { - "waitTime": 0.25 + "name": "Stop Intake" } }, { - "type": "named", + "type": "wait", "data": { - "name": "Deployer Up" + "waitTime": 0.25 } }, { @@ -56,7 +50,7 @@ { "type": "named", "data": { - "name": "Spin Intake Flywheel" + "name": "Deployer Up" } } ] diff --git a/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score + neutral + trench score.auto b/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score + neutral + trench score.auto index 729f6ee..b3c1593 100644 --- a/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score + neutral + trench score.auto +++ b/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score + neutral + trench score.auto @@ -5,84 +5,76 @@ "data": { "commands": [ { - "type": "race", + "type": "path", + "data": { + "pathName": "red-right trench to neutral" + } + }, + { + "type": "path", + "data": { + "pathName": "red-neutral to right trench score" + } + }, + { + "type": "parallel", "data": { "commands": [ { - "type": "path", - "data": { - "pathName": "red-right trench to neutral" - } - }, - { - "type": "wait", + "type": "named", "data": { - "waitTime": 5.0 + "name": "Launch From Neutral Path" } } ] } }, { - "type": "path", + "type": "named", "data": { - "pathName": "red-neutral to right trench score" + "name": "Stop Intake" + } + }, + { + "type": "wait", + "data": { + "waitTime": 0.25 } }, { "type": "named", "data": { - "name": "Stop Intake" + "name": "Deployer Up" } }, { - "type": "race", + "type": "named", "data": { - "commands": [ - { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Launch From Neutral Path" - } - }, - { - "type": "wait", - "data": { - "waitTime": 0.25 - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Spin Intake Flywheel" - } - } - ] - } - }, - { - "type": "wait", - "data": { - "waitTime": 2.0 - } - } - ] + "name": "Deployer Up" + } + }, + { + "type": "wait", + "data": { + "waitTime": 5.0 + } + }, + { + "type": "path", + "data": { + "pathName": "red-right trench score to neutral center " + } + }, + { + "type": "path", + "data": { + "pathName": "red-neutral center to right trench score" } }, { "type": "named", "data": { - "name": "Stop Intake Flywheel" + "name": "Stop Intake" } }, { @@ -92,40 +84,22 @@ { "type": "named", "data": { - "name": "Stop Launching" - } - }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "path", - "data": { - "pathName": "red-right trench score to neutral center " + "name": "Launch From Neutral Path" } } ] } }, { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "path", + "type": "wait", "data": { - "pathName": "red-neutral center to right trench score" + "waitTime": 0.25 } }, { "type": "named", "data": { - "name": "Launch From Neutral Path" + "name": "Deployer Up" } } ] diff --git a/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score 0.75 mps.auto b/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score 0.75 mps.auto deleted file mode 100644 index 1ded90e..0000000 --- a/src/main/deploy/pathplanner/autos/red-right trench + neutral + trench score 0.75 mps.auto +++ /dev/null @@ -1,62 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "red-right trench to neutral 0.75mps" - } - }, - { - "type": "path", - "data": { - "pathName": "red-neutral to right trench score 0.75 mps" - } - }, - { - "type": "parallel", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "Launch From Neutral Path" - } - } - ] - } - }, - { - "type": "named", - "data": { - "name": "Stop Intake" - } - }, - { - "type": "wait", - "data": { - "waitTime": 0.25 - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - }, - { - "type": "named", - "data": { - "name": "Deployer Up" - } - } - ] - } - }, - "resetOdom": true, - "folder": "red", - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/red-center to depot.path b/src/main/deploy/pathplanner/paths/red-center to depot.path index f3ead88..448a332 100644 --- a/src/main/deploy/pathplanner/paths/red-center to depot.path +++ b/src/main/deploy/pathplanner/paths/red-center to depot.path @@ -3,12 +3,12 @@ "waypoints": [ { "anchor": { - "x": 2.83, + "x": 2.33, "y": 4.0346376 }, "prevControl": null, "nextControl": { - "x": 2.3807015306599166, + "x": 1.8807015306599166, "y": 4.0227223206457055 }, "isLocked": false, @@ -16,16 +16,16 @@ }, { "anchor": { - "x": 2.2556109134045084, + "x": 1.9559999999999997, "y": 5.675776986951364 }, "prevControl": { - "x": 2.3524436536180313, + "x": 2.052832740213523, "y": 5.439074733096086 }, "nextControl": { - "x": 2.1609527019743835, - "y": 5.907163726002781 + "x": 1.861341788569874, + "y": 5.907163726002784 }, "isLocked": false, "linkedName": null diff --git a/src/main/deploy/pathplanner/paths/red-depot to center score.path b/src/main/deploy/pathplanner/paths/red-depot to center score.path index 3128d22..1d0635b 100644 --- a/src/main/deploy/pathplanner/paths/red-depot to center score.path +++ b/src/main/deploy/pathplanner/paths/red-depot to center score.path @@ -16,11 +16,11 @@ }, { "anchor": { - "x": 2.83, + "x": 2.33, "y": 4.035 }, "prevControl": { - "x": 2.7074970344009497, + "x": 2.2074970344009497, "y": 4.707449584816134 }, "nextControl": null, @@ -45,8 +45,8 @@ } ], "globalConstraints": { - "maxVelocity": 1.0, - "maxAcceleration": 1.0, + "maxVelocity": 2.0, + "maxAcceleration": 2.0, "maxAngularVelocity": 540.0, "maxAngularAcceleration": 720.0, "nominalVoltage": 12.0, diff --git a/src/main/deploy/pathplanner/paths/red-left trench to neutral.path b/src/main/deploy/pathplanner/paths/red-left trench to neutral.path index 8c958b9..c464a43 100644 --- a/src/main/deploy/pathplanner/paths/red-left trench to neutral.path +++ b/src/main/deploy/pathplanner/paths/red-left trench to neutral.path @@ -97,7 +97,7 @@ } ], "globalConstraints": { - "maxVelocity": 1.5, + "maxVelocity": 2.0, "maxAcceleration": 10.0, "maxAngularVelocity": 720.0, "maxAngularAcceleration": 720.0, diff --git a/src/main/deploy/pathplanner/paths/red-move back to score.path b/src/main/deploy/pathplanner/paths/red-move back to score.path index b1b6ce3..9d2cfe5 100644 --- a/src/main/deploy/pathplanner/paths/red-move back to score.path +++ b/src/main/deploy/pathplanner/paths/red-move back to score.path @@ -16,11 +16,11 @@ }, { "anchor": { - "x": 2.83, + "x": 2.33, "y": 4.035 }, "prevControl": { - "x": 2.5801173435778755, + "x": 2.0801173435778755, "y": 4.042658852356746 }, "nextControl": null, diff --git a/src/main/deploy/pathplanner/paths/red-neutral to left trench score.path b/src/main/deploy/pathplanner/paths/red-neutral to left trench score.path index 3434238..30214f7 100644 --- a/src/main/deploy/pathplanner/paths/red-neutral to left trench score.path +++ b/src/main/deploy/pathplanner/paths/red-neutral to left trench score.path @@ -20,8 +20,8 @@ "y": 7.1390272835151904 }, "prevControl": { - "x": 8.81871886120432, - "y": 8.333297746139309 + "x": 9.045988888888889, + "y": 8.559922222222223 }, "nextControl": null, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/red-neutral to right trench score.path b/src/main/deploy/pathplanner/paths/red-neutral to right trench score.path index 3d1f568..7276b06 100644 --- a/src/main/deploy/pathplanner/paths/red-neutral to right trench score.path +++ b/src/main/deploy/pathplanner/paths/red-neutral to right trench score.path @@ -20,8 +20,8 @@ "y": 0.930326 }, "prevControl": { - "x": 8.818714073313066, - "y": -0.263963355225173 + "x": 9.106455555555558, + "y": -0.5100777777777772 }, "nextControl": null, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/red-right trench to neutral.path b/src/main/deploy/pathplanner/paths/red-right trench to neutral.path index 1169d9c..bd16c90 100644 --- a/src/main/deploy/pathplanner/paths/red-right trench to neutral.path +++ b/src/main/deploy/pathplanner/paths/red-right trench to neutral.path @@ -97,7 +97,7 @@ } ], "globalConstraints": { - "maxVelocity": 1.5, + "maxVelocity": 2.0, "maxAcceleration": 10.0, "maxAngularVelocity": 720.0, "maxAngularAcceleration": 720.0, diff --git a/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java b/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java index bc0ac10..741c102 100644 --- a/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java +++ b/src/main/java/frc/robot/subsystems/controls/combination/AutoControls.java @@ -159,14 +159,15 @@ public static void registerNamedCommands( NamedCommands.registerCommand( "Launch From Center Hub Path", new SequentialCommandGroup( - new InstantCommand(() -> SmartDashboard.putNumber("Controls/launchShooterRPM", 2876)), + new InstantCommand(() -> SmartDashboard.putNumber("Controls/launchShooterRPM", 2700)), launchSequentialParallelSmartDashBoard.asProxy())); NamedCommands.registerCommand( "Launch From Neutral Path", new SequentialCommandGroup( - new InstantCommand(() -> SmartDashboard.putNumber("Controls/launchShooterRPM", 3725)), + new InstantCommand(() -> SmartDashboard.putNumber("Controls/launchShooterRPM", 3000)), launchSequentialParallelSmartDashBoard.asProxy())); NamedCommands.registerCommand("Stop Launching", stopLaunching.asProxy().withTimeout(0.5)); + NamedCommands.registerCommand("Stop Conveyor", stopConveyor.asProxy().withTimeout(0.5)); NamedCommands.registerCommand( "Start Shooter from Radius Distance", @@ -182,7 +183,8 @@ public static void registerNamedCommands( "Start Shooter (3250RPM)", new FlywheelToVelocity(shooter, () -> 3250)); NamedCommands.registerCommand( "Start Shooter (3600RPM)", new FlywheelToVelocity(shooter, () -> 3600)); - NamedCommands.registerCommand("Stop Shooter", stopShooter.asProxy().withTimeout(0.25)); + NamedCommands.registerCommand("Stop Shooter", stopShooter.asProxy().withTimeout(0.75)); + NamedCommands.registerCommand("Stop Shooting Parallel", stopShooter.asProxy().withTimeout(4)); NamedCommands.registerCommand( "Drive to Hub (Radius)", @@ -206,6 +208,7 @@ public static void registerNamedCommands( NamedCommands.registerCommand( "Stop Intake Flywheel", new MotorRunVoltageCommand((Motor) intake, () -> 0.0)); NamedCommands.registerCommand("Stop Intake", stopIntake.asProxy().withTimeout(0.2)); + NamedCommands.registerCommand("Stop Indexer", stopIndexer.asProxy().withTimeout(0.75)); NamedCommands.registerCommand( "Rotate to score", Commands.defer( diff --git a/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java b/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java index bceef50..2049963 100644 --- a/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java +++ b/src/main/java/frc/robot/subsystems/controls/combination/DriverControls.java @@ -185,7 +185,12 @@ public static void setupMainController( Command intakeInDynamic = new ParallelCommandGroup( - new FlywheelToVelocity(intake, () -> SmartDashboard.getNumber(((SubsystemBase) intake).getName() + "/Commands/Set Speed", settings.intakeRPM)), + new FlywheelToVelocity( + intake, + () -> + SmartDashboard.getNumber( + ((SubsystemBase) intake).getName() + "/Commands/Set Speed", + settings.intakeRPM)), new FlywheelToVelocity(conveyor, () -> settings.conveyorLaunchRPM), new MotorRunVoltageCommand( (Motor) intakeArm, () -> settings.intakeArmWhileInakingVolts)); @@ -271,21 +276,21 @@ public static void setupMainController( // "Controls/launchShooterRPM", settings.shooterAgainstHubLaunchRPM))); // // intake uncomment once intake RPM is set. + controller + .leftTrigger() + .whileTrue(intakeIn) + .onFalse(stopIntake) + .onFalse(stopConveyor) + .onFalse(stopIntakeArm); + + // comment once intake RPM is set. // controller // .leftTrigger() - // .whileTrue(intakeIn) + // .whileTrue(intakeInDynamic) // .onFalse(stopIntake) // .onFalse(stopConveyor) // .onFalse(stopIntakeArm); - // comment once intake RPM is set. - controller - .leftTrigger() - .whileTrue(intakeInDynamic) - .onFalse(stopIntake) - .onFalse(stopConveyor) - .onFalse(stopIntakeArm); - controller.leftBumper().whileTrue(intakeOut).onFalse(stopIntake).onFalse(stopConveyor); // deployer diff --git a/src/main/resources/red.properties b/src/main/resources/red.properties index 53b8bfa..ced2b1f 100644 --- a/src/main/resources/red.properties +++ b/src/main/resources/red.properties @@ -147,14 +147,14 @@ driverControls.indexerOutpostLaunchRPM=500.0 driverControls.intakeArmVolts=5.0 driverControls.intakeArmWhileInakingVolts=-2.0 driverControls.intakeDriveSpeed=0.8 -driverControls.intakeRPM=5100.0 +driverControls.intakeRPM=5400.0 driverControls.intakeReverseRPM=-5100.0 -driverControls.shooterAgainstHubLaunchRPM=2876.0 -driverControls.shooterDefaultLaunchRPM=2876.0 -driverControls.shooterDepotLaunchRPM=2300.0 -driverControls.shooterOutpostLaunchRPM=3450.0 +driverControls.shooterAgainstHubLaunchRPM=2650.0 +driverControls.shooterDefaultLaunchRPM=2650.0 +driverControls.shooterDepotLaunchRPM=4000.0 +driverControls.shooterOutpostLaunchRPM=3150.0 driverControls.shooterPassRPM=5500.0 -driverControls.shooterTrenchLaunchRPM=3200.0 +driverControls.shooterTrenchLaunchRPM=2876.0 indexerFlywheel.IOSettings.drumRadiusMeters=1.0 indexerFlywheel.IOSettings.gearing=5.0 indexerFlywheel.IOSettings.inverted=false @@ -241,12 +241,12 @@ intakeFlywheel.talonFXSettings.supplyCurrentLimitAmps=40.0 intakeFlywheel.talonFXSettings.supplyCurrentLowerLimitAmps=30.0 intakeFlywheel.talonFXSettings.supplyCurrentLowerTimeSeconds=1.00 mainCamera.cameraType=photon -mainCamera.robotToCamera.pitchDegrees=-7.5 -mainCamera.robotToCamera.rollDegrees=0 -mainCamera.robotToCamera.xMeters=0.23906 -mainCamera.robotToCamera.yMeters=-0.332271 -mainCamera.robotToCamera.yawDegrees=41 -mainCamera.robotToCamera.zMeters=0.467981 +mainCamera.robotToCamera.pitchDegrees=7.5 +mainCamera.robotToCamera.rollDegrees=90 +mainCamera.robotToCamera.xMeters=-0.128016 +mainCamera.robotToCamera.yMeters=-0.15875 +mainCamera.robotToCamera.yawDegrees=29 +mainCamera.robotToCamera.zMeters=0.503 mainCamera.settings.fps=30 mainCamera.settings.resHeight=600 mainCamera.settings.resWidth=800 diff --git a/src/main/resources/red/red-driver-controls.properties b/src/main/resources/red/red-driver-controls.properties index 470fd0d..309c1a0 100644 --- a/src/main/resources/red/red-driver-controls.properties +++ b/src/main/resources/red/red-driver-controls.properties @@ -1,11 +1,11 @@ -driverControls.shooterDefaultLaunchRPM = 2876.0 +driverControls.shooterDefaultLaunchRPM = 2650.0 #Below Outpost is now Trench -driverControls.shooterOutpostLaunchRPM = 3450.0 +driverControls.shooterOutpostLaunchRPM = 3150.0 #Below is now second closest -driverControls.shooterTrenchLaunchRPM = 3200.0 -driverControls.shooterAgainstHubLaunchRPM = 2876.0 +driverControls.shooterTrenchLaunchRPM = 2876.0 +driverControls.shooterAgainstHubLaunchRPM = 2650.0 # Small Passing -driverControls.shooterDepotLaunchRPM = 2300.0 +driverControls.shooterDepotLaunchRPM = 4000.0 #Third closest driverControls.shooterPassRPM = 5500.0 @@ -17,7 +17,7 @@ driverControls.conveyorOutpostLaunchRPM = 600.0 driverControls.intakeArmVolts = 5.0 -driverControls.intakeRPM = 5100.0 +driverControls.intakeRPM = 5400.0 driverControls.intakeReverseRPM = -5100.0 driverControls.conveyorReverseRPM = -200.0 driverControls.intakeDriveSpeed = 0.8 diff --git a/src/main/resources/red/red-vision.properties b/src/main/resources/red/red-vision.properties index 3cf3993..90a94be 100644 --- a/src/main/resources/red/red-vision.properties +++ b/src/main/resources/red/red-vision.properties @@ -12,12 +12,12 @@ vision.settings.visionLoggingDebug = true mainCamera.cameraType = photon # need to gather -mainCamera.robotToCamera.xMeters = 0.23906 -mainCamera.robotToCamera.yMeters =-0.332271 -mainCamera.robotToCamera.zMeters = 0.467981 -mainCamera.robotToCamera.rollDegrees = 0 -mainCamera.robotToCamera.pitchDegrees =-7.5 -mainCamera.robotToCamera.yawDegrees = 41 +mainCamera.robotToCamera.xMeters = -0.128016 +mainCamera.robotToCamera.yMeters =-0.15875 +mainCamera.robotToCamera.zMeters = 0.503 +mainCamera.robotToCamera.rollDegrees = 90 +mainCamera.robotToCamera.pitchDegrees = 7.5 +mainCamera.robotToCamera.yawDegrees = 29 #for sim mainCamera.settings.fps = 30