From bb9d5a5550fe3d26faeedc991a0921cc28230ef3 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Sat, 22 Feb 2025 10:30:20 -0500 Subject: [PATCH] touche --- src/main/java/frc/robot/RobotContainer.java | 21 ++++---- .../java/frc/robot/commands/CoralInspire.java | 49 ------------------- .../java/frc/robot/commands/StationPince.java | 2 + 3 files changed, 11 insertions(+), 61 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/CoralInspire.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index be01536..4bba20b 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -13,7 +13,6 @@ import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.commands.AlgueExpire; import frc.robot.commands.CoralAlgueInspire; import frc.robot.commands.CoralExpire; -import frc.robot.commands.CoralInspire; import frc.robot.commands.Depart; import frc.robot.commands.DepartPince; import frc.robot.commands.ElevateurManuel; @@ -46,24 +45,22 @@ public class RobotContainer { NamedCommands.registerCommand("L4", new L4(elevateur, pince)); NamedCommands.registerCommand("L3", new L3(elevateur, pince)); NamedCommands.registerCommand("CoralExpire",new CoralExpire(pince,bougie)); - NamedCommands.registerCommand("CoralInspire", new CoralInspire(pince,bougie)); NamedCommands.registerCommand("CoraletAlgue", new CoralAlgueInspire(pince,bougie)); } private void configureBindings() { // manette1 - manette1.a().whileTrue(new AlgueExpire(pince,bougie)); - manette1.b().whileTrue(new CoralAlgueInspire(pince,bougie)); - manette1.x().whileTrue(new CoralInspire(pince,bougie)); - manette1.y().whileTrue(new CoralExpire(pince,bougie)); - manette1.povUp().whileTrue(new L4(elevateur, pince)); - manette1.povRight().whileTrue(new L2(elevateur, pince)); - manette1.povLeft().whileTrue(new L3(elevateur, pince)); - manette1.povDown().whileTrue(new Depart(elevateur, pince)); + manette1.a().whileTrue(new Depart(elevateur, pince)); + manette1.b().whileTrue(new L2(elevateur,pince)); + manette1.x().whileTrue(new L3(elevateur, pince)); + manette1.y().whileTrue(new L4(elevateur, pince)); + manette1.leftTrigger().whileTrue(new CoralExpire(pince, bougie)); + manette1.rightTrigger().whileTrue(new CoralAlgueInspire(pince, bougie)); + manette1.rightBumper().whileTrue(new StationPince(pince, elevateur)); //manette2 - manette2.leftBumper().toggleOnTrue(new DepartPince(pince)); - manette2.a().whileTrue(new StationPince(pince,elevateur)); + manette2.leftTrigger().toggleOnTrue(new AlgueExpire(pince, bougie)); + } public Command getAutonomousCommand() { diff --git a/src/main/java/frc/robot/commands/CoralInspire.java b/src/main/java/frc/robot/commands/CoralInspire.java deleted file mode 100644 index fc249ba..0000000 --- a/src/main/java/frc/robot/commands/CoralInspire.java +++ /dev/null @@ -1,49 +0,0 @@ -// 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; - -import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.subsystems.Pince; -import frc.robot.subsystems.Bougie; -/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */ -public class CoralInspire extends Command { - private Pince pince; - Bougie bougie; - /** Creates a new CoralAlgue. */ - public CoralInspire(Pince pince, Bougie bougie) { - this.pince = pince; - this.bougie = bougie; - addRequirements(pince,bougie); - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() {} - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - if(pince.emperagecoral()>8){ - pince.aspirecoral(0); - } - else{ - pince.aspirecoral(.5); - bougie.Bleu(); - } - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - pince.aspirecoral(0); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/commands/StationPince.java b/src/main/java/frc/robot/commands/StationPince.java index f0c3ccf..1bd807d 100644 --- a/src/main/java/frc/robot/commands/StationPince.java +++ b/src/main/java/frc/robot/commands/StationPince.java @@ -28,6 +28,7 @@ public class StationPince extends Command { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { + pince.aspirecoral(0.5); if(pince.encodeurpivot()>=900 && pince.encodeurpivot()<=910){ pince.pivote(0); } @@ -52,6 +53,7 @@ public class StationPince extends Command { @Override public void end(boolean interrupted) { pince.pivote(0); + pince.aspirecoral(0); } // Returns true when the command should end.