From 34472de0fd82051ccc306d9e5e1da3b5bc56c797 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Wed, 28 Feb 2024 17:52:43 -0500 Subject: [PATCH] fuck les pistons --- src/main/java/frc/robot/RobotContainer.java | 8 +--- .../java/frc/robot/command/GrimpeurDroit.java | 1 - .../java/frc/robot/command/PistonFerme.java | 40 ------------------- .../java/frc/robot/command/PistonOuvre.java | 40 ------------------- .../java/frc/robot/subsystem/Grimpeur.java | 16 -------- 5 files changed, 1 insertion(+), 104 deletions(-) delete mode 100644 src/main/java/frc/robot/command/PistonFerme.java delete mode 100644 src/main/java/frc/robot/command/PistonOuvre.java diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 27daca5..46aa1d6 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -30,8 +30,6 @@ import frc.robot.command.LancerNote; import frc.robot.command.LancerTrape; import frc.robot.command.Lancerampli; import frc.robot.command.Limelight_tracker; -import frc.robot.command.PistonFerme; -import frc.robot.command.PistonOuvre; import frc.robot.command.RestGyro; // Subsystems import frc.robot.subsystem.Accumulateur; @@ -59,7 +57,6 @@ public class RobotContainer { CommandXboxController manette = new CommandXboxController(1); //command - PistonFerme pistonFerme = new PistonFerme(grimpeur); Balayer balayer = new Balayer(balayeuse, accumulateur); GuiderHaut guiderHaut = new GuiderHaut(guideur); GuiderBas guiderBas = new GuiderBas(guideur); @@ -82,16 +79,13 @@ public class RobotContainer { NamedCommands.registerCommand("balayer",new Balayer(balayeuse, accumulateur)); NamedCommands.registerCommand("lancer", new LancerNote(lanceur, accumulateur)); - NamedCommands.registerCommand("piston", new PistonFerme(grimpeur)); autoChooser = AutoBuilder.buildAutoChooser(); //manette manette.start().whileTrue(new RestGyro(drive)); manette.a().whileTrue(new GuiderBas(guideur)); manette.b().whileTrue(new GuiderHaut(guideur)); - manette.x().whileTrue(new PistonFerme(grimpeur)); - manette.y().whileTrue(new PistonOuvre(grimpeur)); - + //joystick joystick.button(3).whileTrue(new Balayer(balayeuse, accumulateur)); joystick.button(1).whileTrue(new LancerNote(lanceur, accumulateur)); diff --git a/src/main/java/frc/robot/command/GrimpeurDroit.java b/src/main/java/frc/robot/command/GrimpeurDroit.java index 135a12e..7e131d6 100644 --- a/src/main/java/frc/robot/command/GrimpeurDroit.java +++ b/src/main/java/frc/robot/command/GrimpeurDroit.java @@ -36,7 +36,6 @@ public class GrimpeurDroit extends Command { @Override public void end(boolean interrupted) { grimpeur.droit(0); - grimpeur.pistonouvre(); } // Returns true when the command should end. diff --git a/src/main/java/frc/robot/command/PistonFerme.java b/src/main/java/frc/robot/command/PistonFerme.java deleted file mode 100644 index c072790..0000000 --- a/src/main/java/frc/robot/command/PistonFerme.java +++ /dev/null @@ -1,40 +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.command; - -import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.subsystem.Grimpeur; - -public class PistonFerme extends Command { - private Grimpeur grimpeur; - /** Creates a new PistonFerme. */ - public PistonFerme(Grimpeur grimpeur) { - this.grimpeur = grimpeur; - addRequirements(grimpeur); - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - grimpeur.pistonouvre(); - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() {} - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - grimpeur.pistonferme(); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return true; - } -} diff --git a/src/main/java/frc/robot/command/PistonOuvre.java b/src/main/java/frc/robot/command/PistonOuvre.java deleted file mode 100644 index c191b2a..0000000 --- a/src/main/java/frc/robot/command/PistonOuvre.java +++ /dev/null @@ -1,40 +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.command; - -import edu.wpi.first.wpilibj2.command.Command; -import frc.robot.subsystem.Grimpeur; - -public class PistonOuvre extends Command { - private Grimpeur grimpeur; - /** Creates a new PistonFerme. */ - public PistonOuvre(Grimpeur grimpeur) { - this.grimpeur = grimpeur; - addRequirements(grimpeur); - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - grimpeur.pistonferme(); - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() {} - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - grimpeur.pistonouvre(); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return true; - } -} diff --git a/src/main/java/frc/robot/subsystem/Grimpeur.java b/src/main/java/frc/robot/subsystem/Grimpeur.java index 47654d7..b1ccb08 100644 --- a/src/main/java/frc/robot/subsystem/Grimpeur.java +++ b/src/main/java/frc/robot/subsystem/Grimpeur.java @@ -4,7 +4,6 @@ package frc.robot.subsystem; -import com.kauailabs.navx.frc.AHRS; import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkLowLevel.MotorType; import edu.wpi.first.wpilibj.PneumaticsModuleType; @@ -31,10 +30,8 @@ public class Grimpeur extends SubsystemBase { final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.REVPH, Constants.pistondroite); //fonction public Grimpeur() { - pistonouvre(); layout.addDouble("grimpeurencodeurd", this::encoderd); layout.addDouble("grimpeurencodeurg", this::encoderg); - layout.addDouble("pitchgyrogrimpeur", this::getpitch); } public void droit(double vitesse){ grimpeurd.set(vitesse); @@ -54,19 +51,6 @@ public double encoderd(){ public double encoderg(){ return grimpeurg.getEncoder().getPosition(); } -public AHRS gyroscope = new AHRS(); - public double getpitch(){ - return gyroscope.getPitch(); - } - public void pistonferme(){ - pistondroite.set(true); - } - public void pistonouvre(){ - pistondroite.set(false); - } - public boolean piston(){ - return pistondroite.get(); - } @Override public void periodic() {