diff --git a/src/main/deploy/pathplanner/autos/Source start to center 3 piece.auto b/src/main/deploy/pathplanner/autos/Source start to center 3 piece.auto index 1191508..254784d 100644 --- a/src/main/deploy/pathplanner/autos/Source start to center 3 piece.auto +++ b/src/main/deploy/pathplanner/autos/Source start to center 3 piece.auto @@ -40,7 +40,7 @@ { "type": "wait", "data": { - "waitTime": 0.25 + "waitTime": 0.1 } }, { @@ -102,7 +102,7 @@ { "type": "wait", "data": { - "waitTime": 0.25 + "waitTime": 0.5 } }, { @@ -135,29 +135,10 @@ "pathName": "bot bot to shoot" } }, - { - "type": "parallel", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "turnToSpeaker" - } - }, - { - "type": "named", - "data": { - "name": "ShootSpeaker" - } - } - ] - } - }, { "type": "named", "data": { - "name": "StopShooter" + "name": "turnTo0" } }, { @@ -169,7 +150,7 @@ { "type": "named", "data": { - "name": "turnTo0" + "name": "StopShooter" } } ] diff --git a/src/main/deploy/pathplanner/paths/bot bot intake.path b/src/main/deploy/pathplanner/paths/bot bot intake.path index 0910f16..c88b505 100644 --- a/src/main/deploy/pathplanner/paths/bot bot intake.path +++ b/src/main/deploy/pathplanner/paths/bot bot intake.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 6.738322308553448, - "y": 0.77 + "x": 7.404889111772525, + "y": 0.6197901854493164 }, "prevControl": null, "nextControl": { - "x": 7.738322308553448, - "y": 0.77 + "x": 7.6048891117725255, + "y": 0.6197901854493164 }, "isLocked": false, "linkedName": "bot bot intake" }, { "anchor": { - "x": 8.001290988336962, - "y": 0.77 + "x": 8.281950694955519, + "y": 0.6197901854493164 }, "prevControl": { - "x": 6.901290988336961, - "y": 0.77 + "x": 8.08195069495552, + "y": 0.6197901854493164 }, "nextControl": null, "isLocked": false, @@ -32,8 +32,8 @@ "constraintZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 2.0, - "maxAcceleration": 1.5, + "maxVelocity": 3.0, + "maxAcceleration": 2.0, "maxAngularVelocity": 360.0, "maxAngularAcceleration": 120.0 }, diff --git a/src/main/deploy/pathplanner/paths/bot bot to shoot.path b/src/main/deploy/pathplanner/paths/bot bot to shoot.path index 90e6529..2af67ac 100644 --- a/src/main/deploy/pathplanner/paths/bot bot to shoot.path +++ b/src/main/deploy/pathplanner/paths/bot bot to shoot.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 8.001290988336962, - "y": 0.77 + "x": 8.281950694955519, + "y": 0.6197901854493164 }, "prevControl": null, "nextControl": { - "x": 6.744492076041221, - "y": 0.3101942986293386 + "x": 6.925428779632487, + "y": 0.3157421699458774 }, "isLocked": false, "linkedName": "bot bot ring" }, { "anchor": { - "x": 3.265158439148787, - "y": 2.8416795295129056 + "x": 2.832474724778509, + "y": 2.7013496762036264 }, "prevControl": { - "x": 2.9623162048835896, - "y": 2.0683408993576364 + "x": 2.9143338058755885, + "y": 1.7892056296933105 }, "nextControl": null, "isLocked": false, @@ -33,13 +33,13 @@ "eventMarkers": [], "globalConstraints": { "maxVelocity": 5.0, - "maxAcceleration": 5.0, + "maxAcceleration": 4.0, "maxAngularVelocity": 360.0, "maxAngularAcceleration": 120.0 }, "goalEndState": { "velocity": 0, - "rotation": 0.0, + "rotation": -40.42607874009909, "rotateFast": false }, "reversed": false, diff --git a/src/main/deploy/pathplanner/paths/bot ring to bot bot intake.path b/src/main/deploy/pathplanner/paths/bot ring to bot bot intake.path index fb1569a..d20082f 100644 --- a/src/main/deploy/pathplanner/paths/bot ring to bot bot intake.path +++ b/src/main/deploy/pathplanner/paths/bot ring to bot bot intake.path @@ -16,12 +16,12 @@ }, { "anchor": { - "x": 6.738322308553448, - "y": 0.77 + "x": 7.404889111772525, + "y": 0.6197901854493164 }, "prevControl": { - "x": 5.738322308553448, - "y": 0.77 + "x": 6.644769073013928, + "y": 0.16371816219415847 }, "nextControl": null, "isLocked": false, @@ -32,13 +32,13 @@ "constraintZones": [], "eventMarkers": [], "globalConstraints": { - "maxVelocity": 5.0, - "maxAcceleration": 4.0, + "maxVelocity": 4.0, + "maxAcceleration": 3.0, "maxAngularVelocity": 360.0, "maxAngularAcceleration": 120.0 }, "goalEndState": { - "velocity": 1.0, + "velocity": 0.0, "rotation": 0.0, "rotateFast": false }, diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 8839e98..486c305 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -106,6 +106,7 @@ public RobotContainer() { NamedCommands.registerCommand("StopShooter", head.SpinDownShooter()); NamedCommands.registerCommand("TurnDown", turnAwayFromAmp()); NamedCommands.registerCommand("TurnAndShoot", Commands.sequence(turnToSpeaker(),MechanismCommands.AutonomousShoot(arm, head, drivetrain))); + NamedCommands.registerCommand("variableShoot", MechanismCommands.PrepareShoot(arm, head, ()->drivetrain.getDistanceToSpeaker()).andThen(MechanismCommands.Shoot(arm, head))); autoChooser = AutoBuilder.buildAutoChooser("Default Path"); @@ -283,9 +284,9 @@ public void setMotorBrake(boolean isBraked) { public Command turnToSpeaker() { if (checkAllianceColors(Alliance.Red)) { - return new ParallelRaceGroup(new TurnToTag(drivetrain, 4, true), Commands.waitSeconds(0.75)); + return new ParallelRaceGroup(new TurnToTag(drivetrain, 4, true), Commands.waitSeconds(1)); } - return new ParallelRaceGroup(new TurnToTag(drivetrain, 7, true), Commands.waitSeconds(0.75)); + return new ParallelRaceGroup(new TurnToTag(drivetrain, 7, true), Commands.waitSeconds(1)); } public Command turnToSpeaker(Supplier yMovement, Supplier xMovement) {