diff --git a/src/main/deploy/pathplanner/autos/1. Hub to Shoot.auto b/src/main/deploy/pathplanner/autos/1. Hub to Shoot.auto deleted file mode 100644 index 732cd97..0000000 --- a/src/main/deploy/pathplanner/autos/1. Hub to Shoot.auto +++ /dev/null @@ -1,88 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "1.1 Hub to Shoot" - } - }, - { - "type": "deadline", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "ChassisAlignShoot" - } - }, - { - "type": "wait", - "data": { - "waitTime": 10.0 - } - } - ] - } - }, - { - "type": "path", - "data": { - "pathName": "1.2 Shoot to Depot Path" - } - }, - { - "type": "deadline", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "RunIntake" - } - }, - { - "type": "wait", - "data": { - "waitTime": 10.0 - } - } - ] - } - }, - { - "type": "path", - "data": { - "pathName": "1.3 Depot to Shoot Path" - } - }, - { - "type": "deadline", - "data": { - "commands": [ - { - "type": "named", - "data": { - "name": "ChassisAlignShoot" - } - }, - { - "type": "wait", - "data": { - "waitTime": 10.0 - } - } - ] - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/9. Chaos Monkey.auto b/src/main/deploy/pathplanner/autos/Chaos Monkey.auto similarity index 100% rename from src/main/deploy/pathplanner/autos/9. Chaos Monkey.auto rename to src/main/deploy/pathplanner/autos/Chaos Monkey.auto diff --git a/src/main/deploy/pathplanner/autos/Depot. Hub.auto b/src/main/deploy/pathplanner/autos/Depot. Hub.auto deleted file mode 100644 index 134ca13..0000000 --- a/src/main/deploy/pathplanner/autos/Depot. Hub.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "S. Hub. shoot 8. E-Hub" - } - }, - { - "type": "path", - "data": { - "pathName": "M. Depot. " - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Depot. L-Tr..auto b/src/main/deploy/pathplanner/autos/Depot. L-Tr..auto deleted file mode 100644 index 597d68e..0000000 --- a/src/main/deploy/pathplanner/autos/Depot. L-Tr..auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "S. L-Tre. Preload." - } - }, - { - "type": "path", - "data": { - "pathName": "M. Depot. " - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Depot. R-Tr.auto b/src/main/deploy/pathplanner/autos/Depot. R-Tr.auto deleted file mode 100644 index 89cb728..0000000 --- a/src/main/deploy/pathplanner/autos/Depot. R-Tr.auto +++ /dev/null @@ -1,25 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "S. R-Trench. E-Hub" - } - }, - { - "type": "path", - "data": { - "pathName": "M. Depot. " - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Shoot 8. Hub.auto b/src/main/deploy/pathplanner/autos/POFC.auto similarity index 68% rename from src/main/deploy/pathplanner/autos/Shoot 8. Hub.auto rename to src/main/deploy/pathplanner/autos/POFC.auto index 3cffb68..0b07ab0 100644 --- a/src/main/deploy/pathplanner/autos/Shoot 8. Hub.auto +++ b/src/main/deploy/pathplanner/autos/POFC.auto @@ -7,7 +7,7 @@ { "type": "path", "data": { - "pathName": "S. Hub. shoot 8. E-Hub" + "pathName": "POFC Path" } }, { @@ -23,11 +23,23 @@ { "type": "named", "data": { - "name": "TurretShoot" + "name": "Ultrashooter" } } ] } + }, + { + "type": "named", + "data": { + "name": "Spin Off" + } + }, + { + "type": "named", + "data": { + "name": "Deploy" + } } ] } diff --git a/src/main/deploy/pathplanner/autos/Relay. L-Tr..auto b/src/main/deploy/pathplanner/autos/Relay. L-Tr..auto deleted file mode 100644 index 527c67d..0000000 --- a/src/main/deploy/pathplanner/autos/Relay. L-Tr..auto +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "Relay. L-Tr." - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Relay. R-Tr..auto b/src/main/deploy/pathplanner/autos/Relay. R-Tr..auto deleted file mode 100644 index aa5298a..0000000 --- a/src/main/deploy/pathplanner/autos/Relay. R-Tr..auto +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "Relay. R-Tr." - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Shoot 8. L-Tr..auto b/src/main/deploy/pathplanner/autos/Shoot 8. L-Tr..auto deleted file mode 100644 index 997f905..0000000 --- a/src/main/deploy/pathplanner/autos/Shoot 8. L-Tr..auto +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "S. L-Tre. Preload." - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/autos/Shoot 8. R-Tr..auto b/src/main/deploy/pathplanner/autos/Shoot 8. R-Tr..auto deleted file mode 100644 index ae61a31..0000000 --- a/src/main/deploy/pathplanner/autos/Shoot 8. R-Tr..auto +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "2025.0", - "command": { - "type": "sequential", - "data": { - "commands": [ - { - "type": "path", - "data": { - "pathName": "S. R-Trench. E-Hub" - } - } - ] - } - }, - "resetOdom": true, - "folder": null, - "choreoAuto": false -} \ No newline at end of file diff --git a/src/main/deploy/pathplanner/paths/New Path.path b/src/main/deploy/pathplanner/paths/POFC Path.path similarity index 74% rename from src/main/deploy/pathplanner/paths/New Path.path rename to src/main/deploy/pathplanner/paths/POFC Path.path index 27c2442..8dcd0b8 100644 --- a/src/main/deploy/pathplanner/paths/New Path.path +++ b/src/main/deploy/pathplanner/paths/POFC Path.path @@ -3,25 +3,25 @@ "waypoints": [ { "anchor": { - "x": 1.347817403708987, - "y": 6.0 + "x": 3.524455555555555, + "y": 4.064233333333333 }, "prevControl": null, "nextControl": { - "x": -0.16600570613409404, - "y": 5.982268188302426 + "x": 2.13655348749465, + "y": 4.298750985192517 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": -0.9164479315263911, - "y": 6.0 + "x": 2.160233333338394, + "y": 4.064233333333333 }, "prevControl": { - "x": -1.916447931526393, - "y": 6.0 + "x": 4.076363279649531, + "y": 3.9399616579759327 }, "nextControl": null, "isLocked": false, @@ -42,7 +42,7 @@ }, "goalEndState": { "velocity": 0, - "rotation": 0.0 + "rotation": 178.3516554952644 }, "reversed": false, "folder": null, diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index a7c0b04..188c468 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -4,6 +4,7 @@ package frc.robot; import com.pathplanner.lib.auto.NamedCommands; +import com.pathplanner.lib.events.EventTrigger; import edu.wpi.first.wpilibj.GenericHID.RumbleType; import edu.wpi.first.wpilibj2.command.Command; @@ -36,7 +37,6 @@ public class RobotContainer { private final CommandXboxController m_driverController = new CommandXboxController(OperatorConstants.kDriverControllerPort); - // private final CommandPS4Controller m_driverController = new CommandPS4Controller(OperatorConstants.kDriverControllerPort); public final DriveSubsystem driveSubsystem = new DriveSubsystem(m_driverController); public final IntakeSubsystem intakeSubsystem = new IntakeSubsystem(); @@ -50,13 +50,15 @@ public class RobotContainer { * commands. */ public RobotContainer() { - - // turretSubsystem.setDefaultCommand(new AutoTurretCommand(turretSubsystem, driveSubsystem)); turretSubsystem.homeTurret(); hopperSubsystem.spindexerOn(); // Configure the trigger bindings configureBindings(); + NamedCommands.registerCommand("Deploy", intakeSubsystem.deploy()); + NamedCommands.registerCommand("Spin Off", hopperSubsystem.spinOff()); + NamedCommands.registerCommand("Ultrashooter", new UltraShooterCommand(hopperSubsystem, turretSubsystem, driveSubsystem)); + NamedCommands.registerCommand("ChassisAlignShoot", new AutoShootCommandChassisTurret(driveSubsystem, hopperSubsystem, turretSubsystem)); NamedCommands.registerCommand("RunIntake", intakeSubsystem.intake(m_driverController.getHID())); NamedCommands.registerCommand("TurretShoot", new AutoTurretShootCommand(hopperSubsystem, turretSubsystem, intakeSubsystem, driveSubsystem)); @@ -93,8 +95,7 @@ public class RobotContainer { */ public Command getAutonomousCommand() { // An example command will be run in autonomous - return Commands.parallel(intakeSubsystem.deploy(), Commands.run(() -> { - turretSubsystem.homeTurret(); - }, turretSubsystem), driveSubsystem.getAutoCommand()); + return Commands.parallel(Commands.run(() -> + {turretSubsystem.homeTurret();}, turretSubsystem), driveSubsystem.getAutoCommand()); } } diff --git a/src/main/java/frc/robot/commands/UltraShooterCommand.java b/src/main/java/frc/robot/commands/UltraShooterCommand.java index 4e7edcb..490afcb 100644 --- a/src/main/java/frc/robot/commands/UltraShooterCommand.java +++ b/src/main/java/frc/robot/commands/UltraShooterCommand.java @@ -15,8 +15,8 @@ import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.DriverStation.Alliance; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.Command; -import edu.wpi.first.wpilibj2.command.CommandScheduler; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.CommandScheduler; import frc.robot.Constants; import frc.robot.Constants.ShootingRegion; import frc.robot.Utils; @@ -47,6 +47,7 @@ public class UltraShooterCommand extends Command{ @Override public void initialize() { + hopperSubsystem.spindexerOn(); hopperSubsystem.stopKicker(); // Make sure kicker is off when command is called CommandScheduler.getInstance().schedule(waitCommand); // Kick off a wait timer so robot doesn't shoot until hopper is ready alliance = DriverStation.getAlliance().get(); // Fetch our alliance @@ -213,5 +214,4 @@ public class UltraShooterCommand extends Command{ Logger.recordOutput("UltraShooter-State", "INACTIVE"); } - } diff --git a/src/main/java/frc/robot/subsystems/HopperSubsystem.java b/src/main/java/frc/robot/subsystems/HopperSubsystem.java index e9b2436..1ece73b 100644 --- a/src/main/java/frc/robot/subsystems/HopperSubsystem.java +++ b/src/main/java/frc/robot/subsystems/HopperSubsystem.java @@ -99,6 +99,8 @@ public class HopperSubsystem extends TestableSubsystem { }); } + public Command spinOff() {return this.runOnce(() -> {spindexerOff();});} + @Override public void periodic() {