diff --git a/src/main/java/frc/robot/subsystem/Grimpeur.java b/src/main/java/frc/robot/subsystem/Grimpeur.java index 8099c2f..8b5ea5f 100644 --- a/src/main/java/frc/robot/subsystem/Grimpeur.java +++ b/src/main/java/frc/robot/subsystem/Grimpeur.java @@ -10,14 +10,12 @@ import com.revrobotics.CANSparkLowLevel.MotorType; import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj.DigitalInput; -import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.Solenoid; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; -import edu.wpi.first.wpilibj.DoubleSolenoid.Value; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -33,15 +31,11 @@ public class Grimpeur extends SubsystemBase { final CANSparkMax grimpeurd = new CANSparkMax(Constants.grimpeurd,MotorType.kBrushless); final CANSparkMax grimpeurg = new CANSparkMax(Constants.grimpeurg,MotorType.kBrushless); // limit switch - final DigitalInput limitdroite = new DigitalInput(Constants.limithaut); - final DigitalInput limitgauche = new DigitalInput(Constants.limitbas); final Solenoid pistondroite= new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondroiteouvre); final Solenoid pistondgauche = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.pistondgaucheouvre); //fonction public Grimpeur() { pistonferme(); - layout.addBoolean("limitgrimpeurd", limitdroite::get); - layout.addBoolean("limitgrimpeurg", limitdroite::get); layout.add("grimpeurencodeurd", encoderd()); layout.add("grimpeurencodeurg", encoderg()); layout.add("pitchgyrogrimpeur", getpitch()); @@ -52,12 +46,6 @@ public void droit(double vitesse){ public void gauche(double vitesse){ grimpeurg.set(vitesse); } -public boolean droite(){ - return limitdroite.get(); -} -public boolean gauche(){ - return limitgauche.get(); -} public void resetencodeurd(){ grimpeurd.getEncoder().setPosition(0); } @@ -85,14 +73,10 @@ public AHRS gyroscope = new AHRS(); public boolean piston(){ return pistondgauche.get(); } - @Override + + @Override public void periodic() { // This method will be called once per scheduler run - if(droite()) { - resetencodeurd(); - } - if(gauche()) { - resetencodeurg(); - } } } +