diff --git a/src/main/deploy/pathplanner/autos/Center Sub 4s.auto b/src/main/deploy/pathplanner/autos/Center Sub 4s.auto new file mode 100644 index 0000000..7d238d3 --- /dev/null +++ b/src/main/deploy/pathplanner/autos/Center Sub 4s.auto @@ -0,0 +1,118 @@ +{ + "version": 1.0, + "startingPose": { + "position": { + "x": 1.3216735004898588, + "y": 5.55593454044051 + }, + "rotation": 180.0 + }, + "command": { + "type": "sequential", + "data": { + "commands": [ + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Center Sub to Note 1" + } + }, + { + "type": "named", + "data": { + "name": "Auto Intake" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Note 1 to Center Sub" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Center Sub to Note 2" + } + }, + { + "type": "named", + "data": { + "name": "Auto Intake" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Note 2 to Center Sub" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + }, + { + "type": "parallel", + "data": { + "commands": [ + { + "type": "path", + "data": { + "pathName": "Left Sub to Note 3" + } + }, + { + "type": "named", + "data": { + "name": "Auto Intake" + } + } + ] + } + }, + { + "type": "path", + "data": { + "pathName": "Left Note 3 to Sub" + } + }, + { + "type": "named", + "data": { + "name": "Speaker Note Shot" + } + } + ] + } + }, + "folder": null, + "choreoAuto": false +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/From Subwoofer Far Edge to Amp.auto b/src/main/deploy/pathplanner/autos/From Subwoofer Far Edge to Amp.auto deleted file mode 100644 index b55d3e5..0000000 --- a/src/main/deploy/pathplanner/autos/From Subwoofer Far Edge to Amp.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 0.7046435911053639, - "y": 4.3751818412727745 - }, - "rotation": 120.0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "From Subwoofer Far Edge to Amp" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/From Subwoofer Front to Amp.auto b/src/main/deploy/pathplanner/autos/From Subwoofer Front to Amp.auto deleted file mode 100644 index 6538ed7..0000000 --- a/src/main/deploy/pathplanner/autos/From Subwoofer Front to Amp.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 1.29, - "y": 5.58 - }, - "rotation": 0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "From Subwoofer Front to Amp" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/He He He Haw.auto b/src/main/deploy/pathplanner/autos/He He He Haw.auto deleted file mode 100644 index 80b89eb..0000000 --- a/src/main/deploy/pathplanner/autos/He He He Haw.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 0.4585613729632017, - "y": 7.0398809743488435 - }, - "rotation": 180.0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "He He He Haw" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Left Sub 4s.auto b/src/main/deploy/pathplanner/autos/Left Sub 4s.auto index 4b2448f..47229e0 100644 --- a/src/main/deploy/pathplanner/autos/Left Sub 4s.auto +++ b/src/main/deploy/pathplanner/autos/Left Sub 4s.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 0.4936438362905214, - "y": 6.981410202136645 + "x": 0.5740411480822968, + "y": 7.021880329474945 }, "rotation": 180.0 }, diff --git a/src/main/deploy/pathplanner/paths/From Subwoofer Far Edge to Amp.path b/src/main/deploy/pathplanner/paths/Center Sub to Note 1.path similarity index 69% rename from src/main/deploy/pathplanner/paths/From Subwoofer Far Edge to Amp.path rename to src/main/deploy/pathplanner/paths/Center Sub to Note 1.path index 17ff326..a2e0332 100644 --- a/src/main/deploy/pathplanner/paths/From Subwoofer Far Edge to Amp.path +++ b/src/main/deploy/pathplanner/paths/Center Sub to Note 1.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 0.7046435911053639, - "y": 4.3751818412727745 + "x": 1.3216735004898588, + "y": 5.55593454044051 }, "prevControl": null, "nextControl": { - "x": 2.4368920788482864, - "y": 3.1622483921028106 + "x": 1.8054356108712222, + "y": 6.010377735041184 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 1.82409310273166, - "y": 7.565612949407717 + "x": 2.421132842265685, + "y": 6.728691171668058 }, "prevControl": { - "x": 1.8176568333482528, - "y": 6.336387277909188 + "x": 2.1572626002394863, + "y": 6.3328858086287605 }, "nextControl": null, "isLocked": false, @@ -39,13 +39,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": 89.21368742867472, + "rotation": -151.8214098900407, "rotateFast": false }, "reversed": false, "folder": null, "previewStartingState": { - "rotation": 122.73522627210761, + "rotation": 180.0, "velocity": 0 }, "useDefaultConstraints": true diff --git a/src/main/deploy/pathplanner/paths/From Subwoofer Front to Amp.path b/src/main/deploy/pathplanner/paths/Center Sub to Note 2.path similarity index 71% rename from src/main/deploy/pathplanner/paths/From Subwoofer Front to Amp.path rename to src/main/deploy/pathplanner/paths/Center Sub to Note 2.path index 4b7e77d..a9e4f55 100644 --- a/src/main/deploy/pathplanner/paths/From Subwoofer Front to Amp.path +++ b/src/main/deploy/pathplanner/paths/Center Sub to Note 2.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 1.2945574370576298, - "y": 5.580559282764361 + "x": 1.3216735004898588, + "y": 5.541275082550166 }, "prevControl": null, "nextControl": { - "x": 2.2786077412442953, - "y": 5.580559282764361 + "x": 2.3216735004898608, + "y": 5.541275082550166 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 1.8232420006879377, - "y": 7.533755031731888 + "x": 2.289197721252586, + "y": 5.541275082550166 }, "prevControl": { - "x": 1.8232420006879377, - "y": 6.694612522270728 + "x": 1.2891977212525858, + "y": 5.541275082550166 }, "nextControl": null, "isLocked": false, @@ -39,13 +39,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": 90.0, + "rotation": 180.0, "rotateFast": false }, "reversed": false, "folder": null, "previewStartingState": { - "rotation": 0, + "rotation": 180.0, "velocity": 0 }, "useDefaultConstraints": true diff --git a/src/main/deploy/pathplanner/paths/Gremlin Start.path b/src/main/deploy/pathplanner/paths/Gremlin Start.path index 318772e..5c4b590 100644 --- a/src/main/deploy/pathplanner/paths/Gremlin Start.path +++ b/src/main/deploy/pathplanner/paths/Gremlin Start.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 0.4585613729632017, - "y": 4.0695657459691 + "x": 0.66, + "y": 4.38 }, "prevControl": null, "nextControl": { - "x": 0.7743035429090797, - "y": 3.9643183559871398 + "x": 0.8945513262455097, + "y": 3.688073587575746 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 0.9029392417759192, - "y": 4.408696224799858 + "x": 0.9539344375942316, + "y": 4.503791885637482 }, "prevControl": { - "x": 1.2654580294915574, - "y": 4.02278912819934 + "x": 1.3164532253098697, + "y": 4.117884789036965 }, "nextControl": null, "isLocked": false, @@ -39,13 +39,13 @@ }, "goalEndState": { "velocity": 0, - "rotation": 132.79740183823424, + "rotation": 133.4021151464655, "rotateFast": false }, "reversed": false, "folder": null, "previewStartingState": { - "rotation": 180.0, + "rotation": 119.88721357012417, "velocity": 0 }, "useDefaultConstraints": true diff --git a/src/main/deploy/pathplanner/paths/He He He Haw.path b/src/main/deploy/pathplanner/paths/He He He Haw.path deleted file mode 100644 index c96613e..0000000 --- a/src/main/deploy/pathplanner/paths/He He He Haw.path +++ /dev/null @@ -1,74 +0,0 @@ -{ - "version": 1.0, - "waypoints": [ - { - "anchor": { - "x": 0.4585613729632017, - "y": 7.0398809743488435 - }, - "prevControl": null, - "nextControl": { - "x": 1.4585613729632003, - "y": 7.0398809743488435 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 2.7856981070087494, - "y": 5.98740707452925 - }, - "prevControl": { - "x": 1.7856981070087494, - "y": 5.98740707452925 - }, - "nextControl": { - "x": 3.7856981070087494, - "y": 5.98740707452925 - }, - "isLocked": false, - "linkedName": null - }, - { - "anchor": { - "x": 4.69184528112646, - "y": 7.051575128791284 - }, - "prevControl": { - "x": 4.238771694067605, - "y": 6.519491101660266 - }, - "nextControl": null, - "isLocked": false, - "linkedName": null - } - ], - "rotationTargets": [ - { - "waypointRelativePos": 1.0, - "rotationDegrees": 90.0, - "rotateFast": false - } - ], - "constraintZones": [], - "eventMarkers": [], - "globalConstraints": { - "maxVelocity": 4.0, - "maxAcceleration": 4.0, - "maxAngularVelocity": 540.0, - "maxAngularAcceleration": 720.0 - }, - "goalEndState": { - "velocity": 0, - "rotation": 88.210089391754, - "rotateFast": false - }, - "reversed": false, - "folder": null, - "previewStartingState": { - "rotation": 0, - "velocity": 0 - }, - "useDefaultConstraints": true -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Note 1 to amp.path b/src/main/deploy/pathplanner/paths/Note 1 to Center Sub.path similarity index 54% rename from src/main/deploy/pathplanner/paths/Note 1 to amp.path rename to src/main/deploy/pathplanner/paths/Note 1 to Center Sub.path index 7b99108..e0eb721 100644 --- a/src/main/deploy/pathplanner/paths/Note 1 to amp.path +++ b/src/main/deploy/pathplanner/paths/Note 1 to Center Sub.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 2.353014392638472, - "y": 6.993104356579084 + "x": 2.230559889691208, + "y": 6.640734424325992 }, "prevControl": null, "nextControl": { - "x": 1.768306670516475, - "y": 7.004798511021523 + "x": 1.8200950687615667, + "y": 5.863783156137741 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 1.8384715971711143, - "y": 7.624588696470841 + "x": 1.3070140425995143, + "y": 5.570593998330854 }, "prevControl": { - "x": 1.7950792079196904, - "y": 7.315863019194643 + "x": 1.8494139845422553, + "y": 5.629231829892232 }, "nextControl": null, "isLocked": false, @@ -30,18 +30,7 @@ ], "rotationTargets": [], "constraintZones": [], - "eventMarkers": [ - { - "name": "New Event Marker", - "waypointRelativePos": 0, - "command": { - "type": "parallel", - "data": { - "commands": [] - } - } - } - ], + "eventMarkers": [], "globalConstraints": { "maxVelocity": 4.0, "maxAcceleration": 4.0, @@ -49,14 +38,14 @@ "maxAngularAcceleration": 720.0 }, "goalEndState": { - "velocity": 0.0, - "rotation": 90.0, - "rotateFast": true + "velocity": 0, + "rotation": 180.0, + "rotateFast": false }, "reversed": false, "folder": null, "previewStartingState": { - "rotation": -178.36342295838335, + "rotation": 180.0, "velocity": 0 }, "useDefaultConstraints": true diff --git a/src/main/deploy/pathplanner/paths/Note 2 to Center Sub.path b/src/main/deploy/pathplanner/paths/Note 2 to Center Sub.path new file mode 100644 index 0000000..01d22d8 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/Note 2 to Center Sub.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.503225806451614, + "y": 5.535411299394028 + }, + "prevControl": null, + "nextControl": { + "x": 2.016531804492181, + "y": 5.541275082550166 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.3480605246924788, + "y": 5.535411299394028 + }, + "prevControl": { + "x": 1.6881599477484674, + "y": 5.55300264886244 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 4.0, + "maxAcceleration": 4.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -178.53119928561404, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 180.0, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/Right Subwoofer to Center.path b/src/main/deploy/pathplanner/paths/Right Subwoofer to Center.path index bc6daf2..6c07c32 100644 --- a/src/main/deploy/pathplanner/paths/Right Subwoofer to Center.path +++ b/src/main/deploy/pathplanner/paths/Right Subwoofer to Center.path @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 7.0095431619434665, - "y": 0.8355890997496291 + "x": 7.639899851228273, + "y": 0.7769512681882514 }, "prevControl": { - "x": 6.0095431619434665, - "y": 0.8355890997496291 + "x": 6.639899851228273, + "y": 0.7769512681882514 }, "nextControl": null, "isLocked": false, @@ -39,7 +39,7 @@ }, "goalEndState": { "velocity": 0, - "rotation": 0, + "rotation": 180.0, "rotateFast": false }, "reversed": false, diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index f82c80c..f7538b0 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -233,8 +233,6 @@ public class RobotContainer { ) ); - //intake.setDefaultCommand(intake.intakeUpCommand()); - //intake.setDefaultCommand(intake.manualPivot(() -> -operator.getLeftY(), operator::getRightY)); intake.setDefaultCommand( intake.intakeControl( () -> { @@ -247,6 +245,8 @@ public class RobotContainer { () -> { if(intakeDown && indexer.getBeamBreak()){ return 1.0; + }else if(operator.leftBumper().getAsBoolean()){ + return -1.0; }else{ return 0.0; } @@ -290,7 +290,6 @@ public class RobotContainer { } ) ); - //shooter.setDefaultCommand(shooter.manualPivot(operator::getRightY, operator::getLeftTriggerAxis)); driver.leftBumper().onTrue( shooter.angleSpeedsSetpoints( @@ -415,18 +414,13 @@ public class RobotContainer { driver.a().whileTrue(indexer.shootNote(() -> 1.0)); operator.back().toggleOnTrue(shooter.manualPivot( - () -> MathUtil.clamp(-operator.getLeftY(), -0.75, 0.75), - () -> MathUtil.clamp(operator.getRightTriggerAxis()-operator.getLeftTriggerAxis(), -0.75, 0.75) + () -> MathUtil.clamp(-operator.getLeftY(), -0.5, 0.5), + () -> MathUtil.clamp(driver.getRightTriggerAxis(), -1, 1) )); driver.povDown().whileTrue(indexer.shootNote(() -> -1.0)); operator.start().toggleOnTrue(intake.manualPivot(() -> -operator.getRightY()*0.2, () -> driver.getLeftTriggerAxis())); - - //operator.povDown().whileTrue(intake.intakeDownCommand()); - //operator.povUp().whileTrue(intake.intakeUpCommand()); - - //driver.leftTrigger().whileTrue(Commands.parallel( intake.manualPivot(() -> 0.0, () -> 1.0), indexer.advanceNote())); } diff --git a/src/main/java/frc/robot/subsystems/Climber.java b/src/main/java/frc/robot/subsystems/Climber.java index d60bc30..46228dc 100644 --- a/src/main/java/frc/robot/subsystems/Climber.java +++ b/src/main/java/frc/robot/subsystems/Climber.java @@ -29,9 +29,11 @@ public class Climber extends SubsystemBase { public Command setSpeedWithSupplier(DoubleSupplier speed) { return run(() -> { - - motor1.set(VictorSPXControlMode.PercentOutput, speed.getAsDouble()); - + if(shooterAngle.getAsDouble() <= ShooterConstants.kShooterLoadAngle){ + + motor1.set(VictorSPXControlMode.PercentOutput, speed.getAsDouble()); + + } }); } diff --git a/src/main/java/frc/robot/subsystems/Shooter.java b/src/main/java/frc/robot/subsystems/Shooter.java index 40f73d0..2f54f42 100644 --- a/src/main/java/frc/robot/subsystems/Shooter.java +++ b/src/main/java/frc/robot/subsystems/Shooter.java @@ -141,9 +141,14 @@ public class Shooter extends SubsystemBase{ public Command manualPivot(DoubleSupplier pivotPower, DoubleSupplier spinny){ return run(() ->{ - shooterPivot.set(pivotPower.getAsDouble()); + shooterPivot.setIdleMode(IdleMode.kBrake); + if(getShooterAngle() >= ShooterConstants.kShooterLoadAngle || getShooterAngle() <= ShooterConstants.kShooterAmpAngle){ + shooterPivot.set(pivotPower.getAsDouble()); + } + topShooter.set(spinny.getAsDouble()); bottomShooter.set(spinny.getAsDouble()); + }); } diff --git a/vendordeps/PathplannerLib.json b/vendordeps/PathplannerLib.json index 3ec4c12..a019706 100644 --- a/vendordeps/PathplannerLib.json +++ b/vendordeps/PathplannerLib.json @@ -1,7 +1,7 @@ { "fileName": "PathplannerLib.json", "name": "PathplannerLib", - "version": "2024.2.6", + "version": "2024.2.7", "uuid": "1b42324f-17c6-4875-8e77-1c312bc8c786", "frcYear": "2024", "mavenUrls": [ @@ -12,7 +12,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-java", - "version": "2024.2.6" + "version": "2024.2.7" } ], "jniDependencies": [], @@ -20,7 +20,7 @@ { "groupId": "com.pathplanner.lib", "artifactId": "PathplannerLib-cpp", - "version": "2024.2.6", + "version": "2024.2.7", "libName": "PathplannerLib", "headerClassifier": "headers", "sharedLibrary": false, diff --git a/vendordeps/REVLib.json b/vendordeps/REVLib.json index 60eacf8..f85acd4 100644 --- a/vendordeps/REVLib.json +++ b/vendordeps/REVLib.json @@ -1,7 +1,7 @@ { "fileName": "REVLib.json", "name": "REVLib", - "version": "2024.2.3", + "version": "2024.2.4", "frcYear": "2024", "uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb", "mavenUrls": [ @@ -12,14 +12,14 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-java", - "version": "2024.2.3" + "version": "2024.2.4" } ], "jniDependencies": [ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2024.2.3", + "version": "2024.2.4", "skipInvalidPlatforms": true, "isJar": false, "validPlatforms": [ @@ -37,7 +37,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-cpp", - "version": "2024.2.3", + "version": "2024.2.4", "libName": "REVLib", "headerClassifier": "headers", "sharedLibrary": false, @@ -55,7 +55,7 @@ { "groupId": "com.revrobotics.frc", "artifactId": "REVLib-driver", - "version": "2024.2.3", + "version": "2024.2.4", "libName": "REVLibDriver", "headerClassifier": "headers", "sharedLibrary": false,