diff --git a/src/main/deploy/pathplanner/autos/BLUE AMP SIDE Auto.auto b/src/main/deploy/pathplanner/autos/BLUE AMP SIDE Auto.auto deleted file mode 100644 index 649472d..0000000 --- a/src/main/deploy/pathplanner/autos/BLUE AMP SIDE Auto.auto +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 0.4234789096358818, - "y": 6.981410202136645 - }, - "rotation": 2.145150039040434 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "SHOOTCONVEYOR" - } - }, - { - "type": "named", - "data": { - "name": "SHOOTFLYS" - } - }, - { - "type": "wait", - "data": { - "waitTime": 2.0 - } - }, - { - "type": "path", - "data": { - "pathName": "BLS Path" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/BLUE SOURCE SIDE Auto.auto b/src/main/deploy/pathplanner/autos/BLUE SOURCE SIDE Auto.auto deleted file mode 100644 index af696be..0000000 --- a/src/main/deploy/pathplanner/autos/BLUE SOURCE SIDE Auto.auto +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 0.79769185179396, - "y": 4.572414386994017 - }, - "rotation": -125.24061873233006 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "SHOOTCONVEYOR" - } - }, - { - "type": "named", - "data": { - "name": "SHOOTFLYS" - } - }, - { - "type": "wait", - "data": { - "waitTime": 2.0 - } - }, - { - "type": "path", - "data": { - "pathName": "BRS Path" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/RED Middle Shoot Auto.auto b/src/main/deploy/pathplanner/autos/D Amp to Speaker Score.auto similarity index 76% rename from src/main/deploy/pathplanner/autos/RED Middle Shoot Auto.auto rename to src/main/deploy/pathplanner/autos/D Amp to Speaker Score.auto index 4986d8b..b50f7b4 100644 --- a/src/main/deploy/pathplanner/autos/RED Middle Shoot Auto.auto +++ b/src/main/deploy/pathplanner/autos/D Amp to Speaker Score.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 15.319384055583853, - "y": 5.551187918118234 + "x": 2.0, + "y": 7.0 }, "rotation": 0 }, @@ -12,27 +12,33 @@ "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "SHOOTCONVEYOR" + "pathName": "D Amp to Speaker Score" + } + }, + { + "type": "wait", + "data": { + "waitTime": 2.0 } }, { "type": "named", "data": { - "name": "SHOOTFLYS" + "name": "SHOOTCONVEYOR" } }, { - "type": "wait", + "type": "named", "data": { - "waitTime": 2.0 + "name": "SHOOTFLYS" } }, { "type": "path", "data": { - "pathName": "RS Path" + "pathName": "D Leave Zone" } } ] diff --git a/src/main/deploy/pathplanner/autos/BLUE TAXI.auto b/src/main/deploy/pathplanner/autos/D Leave Zone.auto similarity index 76% rename from src/main/deploy/pathplanner/autos/BLUE TAXI.auto rename to src/main/deploy/pathplanner/autos/D Leave Zone.auto index a9f9f7a..61acc62 100644 --- a/src/main/deploy/pathplanner/autos/BLUE TAXI.auto +++ b/src/main/deploy/pathplanner/autos/D Leave Zone.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 0.400090600751002, - "y": 1.9997004096572308 + "x": 2.0, + "y": 7.0 }, "rotation": 0 }, @@ -14,7 +14,7 @@ { "type": "path", "data": { - "pathName": "BR Path" + "pathName": "D Leave Zone" } } ] diff --git a/src/main/deploy/pathplanner/autos/RED TAXI.auto b/src/main/deploy/pathplanner/autos/D Source Leave Zone.auto similarity index 73% rename from src/main/deploy/pathplanner/autos/RED TAXI.auto rename to src/main/deploy/pathplanner/autos/D Source Leave Zone.auto index 1332884..239749c 100644 --- a/src/main/deploy/pathplanner/autos/RED TAXI.auto +++ b/src/main/deploy/pathplanner/autos/D Source Leave Zone.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 16.112410901029318, - "y": 2.0413098429059118 + "x": 1.9169897697665406, + "y": 1.792603115355015 }, "rotation": 0 }, @@ -14,7 +14,7 @@ { "type": "path", "data": { - "pathName": "RR Path" + "pathName": "D Source Leave Zone" } } ] diff --git a/src/main/deploy/pathplanner/autos/BLUE Middle Shoot Auto.auto b/src/main/deploy/pathplanner/autos/D-1-AMP.auto similarity index 75% rename from src/main/deploy/pathplanner/autos/BLUE Middle Shoot Auto.auto rename to src/main/deploy/pathplanner/autos/D-1-AMP.auto index 27122dd..f7932dc 100644 --- a/src/main/deploy/pathplanner/autos/BLUE Middle Shoot Auto.auto +++ b/src/main/deploy/pathplanner/autos/D-1-AMP.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 1.3674277229789629, - "y": 5.557362183607978 + "x": 2.0, + "y": 7.0 }, "rotation": 0 }, @@ -12,27 +12,27 @@ "data": { "commands": [ { - "type": "named", + "type": "path", "data": { - "name": "SHOOTCONVEYOR" + "pathName": "D-Amp-2" } }, { "type": "named", "data": { - "name": "SHOOTFLYS" + "name": "SHOOTCONVEYOR" } }, { - "type": "wait", + "type": "named", "data": { - "waitTime": 2.0 + "name": "SHOOTFLYSLOW" } }, { "type": "path", "data": { - "pathName": "BS Path" + "pathName": "D Leave Zone" } } ] diff --git a/src/main/deploy/pathplanner/autos/RED AMP SIDE Auto.auto b/src/main/deploy/pathplanner/autos/RED AMP SIDE Auto.auto deleted file mode 100644 index bec19dc..0000000 --- a/src/main/deploy/pathplanner/autos/RED AMP SIDE Auto.auto +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 16.147134266099517, - "y": 6.9085276198721415 - }, - "rotation": 0.0 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "SHOOTCONVEYOR" - } - }, - { - "type": "named", - "data": { - "name": "SHOOTFLYS" - } - }, - { - "type": "wait", - "data": { - "waitTime": 2.0 - } - }, - { - "type": "path", - "data": { - "pathName": "Straight Red Amp Path" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/RED SOURCE SIDE Auto.auto b/src/main/deploy/pathplanner/autos/RED SOURCE SIDE Auto.auto deleted file mode 100644 index b5b6605..0000000 --- a/src/main/deploy/pathplanner/autos/RED SOURCE SIDE Auto.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": 1.0, - "startingPose": { - "position": { - "x": 16.1521166347176, - "y": 4.234725089168489 - }, - "rotation": -1.7858847665219348 - }, - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "RRS Path" - } - } - ] - } - }, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/D Amp to Speaker Score.path b/src/main/deploy/pathplanner/paths/D Amp to Speaker Score.path new file mode 100644 index 0000000..93b9ece --- /dev/null +++ b/src/main/deploy/pathplanner/paths/D Amp to Speaker Score.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.0, + "y": 7.0 + }, + "prevControl": null, + "nextControl": { + "x": 3.0, + "y": 7.0 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.372979159427387, + "y": 5.522961586252069 + }, + "prevControl": { + "x": 2.3638556282594165, + "y": 5.445245784775046 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "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/D Leave Zone.path b/src/main/deploy/pathplanner/paths/D Leave Zone.path new file mode 100644 index 0000000..c235ed9 --- /dev/null +++ b/src/main/deploy/pathplanner/paths/D Leave Zone.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 2.0, + "y": 7.0 + }, + "prevControl": null, + "nextControl": { + "x": 2.078897689510336, + "y": 5.31571944898001 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 2.901389921808818, + "y": 6.306595917812039 + }, + "prevControl": { + "x": 1.4830765448489962, + "y": 6.196060346707785 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "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/D Source Leave Zone.path b/src/main/deploy/pathplanner/paths/D Source Leave Zone.path new file mode 100644 index 0000000..238686e --- /dev/null +++ b/src/main/deploy/pathplanner/paths/D Source Leave Zone.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 0.9520185680935184, + "y": 1.5983136116624606 + }, + "prevControl": null, + "nextControl": { + "x": 1.9520185680935191, + "y": 1.5983136116624606 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 3.756263738056059, + "y": 0.81467928010249 + }, + "prevControl": { + "x": 2.756263738056059, + "y": 0.81467928010249 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": 0, + "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/D-1-AMP.path b/src/main/deploy/pathplanner/paths/D-1-AMP.path new file mode 100644 index 0000000..3b714ca --- /dev/null +++ b/src/main/deploy/pathplanner/paths/D-1-AMP.path @@ -0,0 +1,68 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.2823107243708616, + "y": 6.41669330323782 + }, + "prevControl": null, + "nextControl": { + "x": 2.2823107243708582, + "y": 6.41669330323782 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.8457502850792704, + "y": 7.51766715749563 + }, + "prevControl": { + "x": 0.9579957536303425, + "y": 7.977984321950629 + }, + "nextControl": { + "x": 2.5451924983724674, + "y": 7.154993417269528 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.8457502850792704, + "y": 7.51766715749563 + }, + "prevControl": { + "x": 2.34575028507927, + "y": 7.51766715749563 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -88.99491399474583, + "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/D-Amp-2.path b/src/main/deploy/pathplanner/paths/D-Amp-2.path new file mode 100644 index 0000000..93847fb --- /dev/null +++ b/src/main/deploy/pathplanner/paths/D-Amp-2.path @@ -0,0 +1,52 @@ +{ + "version": 1.0, + "waypoints": [ + { + "anchor": { + "x": 1.2110712396835914, + "y": 6.37783540249931 + }, + "prevControl": null, + "nextControl": { + "x": 2.2110712396835854, + "y": 6.37783540249931 + }, + "isLocked": false, + "linkedName": null + }, + { + "anchor": { + "x": 1.8327976514997666, + "y": 7.5759540086033965 + }, + "prevControl": { + "x": 1.8263213347100147, + "y": 8.04872513425528 + }, + "nextControl": null, + "isLocked": false, + "linkedName": null + } + ], + "rotationTargets": [], + "constraintZones": [], + "eventMarkers": [], + "globalConstraints": { + "maxVelocity": 3.0, + "maxAcceleration": 3.0, + "maxAngularVelocity": 540.0, + "maxAngularAcceleration": 720.0 + }, + "goalEndState": { + "velocity": 0, + "rotation": -90.0, + "rotateFast": false + }, + "reversed": false, + "folder": null, + "previewStartingState": { + "rotation": 0, + "velocity": 0 + }, + "useDefaultConstraints": true +} \ No newline at end of file diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 766580a..dc5426d 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -62,9 +62,10 @@ public static class OperatorConstants { // TODO: Add button binds for driver controllers // Joystick Deadband - public static final double LEFT_X_DEADBAND = 0.1; - public static final double LEFT_Y_DEADBAND = 0.1; - public static final double RIGHT_X_DEADBAND = 0.1; + public static final double LEFT_X_DEADBAND = 0.2; + public static final double LEFT_Y_DEADBAND = 0.2; + public static final double RIGHT_X_DEADBAND = 0.5; + public static final double RIGHT_Y_DEADBAND = 0.5; public static final double TURN_CONSTANT = 6; } @@ -75,14 +76,14 @@ public static class MechanismConstants { public static final int INTAKE_MOTOR_FRONT = 52; public static final boolean INTAKE_MOTOR_SUSHI_INVERTED = true; public static final boolean INTAKE_MOTOR_FRONT_INVERTED = false; - public static final double INTAKE_MOTOR_SPEED_FRONT = 0.1; + public static final double INTAKE_MOTOR_SPEED_FRONT = 0.5; public static final double INTAKE_MOTOR_SPEED_SUSHI = 1; // Conveyor Motors public static final int CONVEYOR_MOTOR_1 = 1; public static final int CONVEYOR_MOTOR_2 = 2; public static final boolean CONVEYOR_MOTOR_1_INVERTED = false; public static final boolean CONVEYOR_MOTOR_2_INVERTED = true; - public static final double CONVEYOR_MOTOR_SPEED = 0.38; + public static final double CONVEYOR_MOTOR_SPEED = 0.4; // Flywheel Motors public static final int FLYWHEEL_MOTOR_1 = 3; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 707c89f..34c51ff 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -123,8 +123,11 @@ public RobotContainer() { drivebase.driveCommand( () -> MathUtil.applyDeadband(-driverXbox.getLeftY(), OperatorConstants.LEFT_Y_DEADBAND), () -> MathUtil.applyDeadband(-driverXbox.getLeftX(), OperatorConstants.LEFT_X_DEADBAND), - () -> driverXbox.getRightX(), - () -> driverXbox.getRightY()); + () -> + MathUtil.applyDeadband(-driverXbox.getRightX(), OperatorConstants.RIGHT_X_DEADBAND), + () -> + MathUtil.applyDeadband( + -driverXbox.getRightY(), OperatorConstants.RIGHT_Y_DEADBAND)); // Applies deadbands and inverts controls because joysticks // are back-right positive while robot diff --git a/src/main/java/frc/robot/commands/auto/SHOOTFLYSLOW.java b/src/main/java/frc/robot/commands/auto/SHOOTFLYSLOW.java new file mode 100644 index 0000000..1856d43 --- /dev/null +++ b/src/main/java/frc/robot/commands/auto/SHOOTFLYSLOW.java @@ -0,0 +1,44 @@ +// 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.commands.auto; + +import edu.wpi.first.wpilibj2.command.Command; +import frc.robot.subsystems.FlyWheel; + +public class SHOOTFLYSLOW extends Command { + /** Creates a new SHOOTFLYS. */ + private final FlyWheel m_flywheel; + + private boolean m_finished = false; + + public SHOOTFLYSLOW(FlyWheel flywheel) { + m_flywheel = flywheel; + addRequirements(m_flywheel); + // Use addRequirements() here to declare subsystem dependencies. + } + + // Called when the command is initially scheduled. + @Override + public void initialize() { + m_finished = false; + m_flywheel.enableflywheellow(); + } + + // Called every time the scheduler runs while the command is scheduled. + @Override + public void execute() { + m_finished = true; + } + + // Called once the command ends or is interrupted. + @Override + public void end(boolean interrupted) {} + + // Returns true when the command should end. + @Override + public boolean isFinished() { + return m_finished; + } +}