This commit is contained in:
Antoine PerreaultE 2023-02-20 18:53:50 -05:00
parent 02669953cb
commit be2188d63e
2 changed files with 10 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot;
import pabeles.concurrency.ConcurrencyOps.Reset;
import frc.robot.subsystems.Limelight;
// command
import frc.robot.commands.BrakeFerme;
@ -66,7 +67,10 @@ public RobotContainer() {
private void configureBindings() {
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
manette1.y().whileTrue(gyro);
manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte));
manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable));
}

View File

@ -8,6 +8,7 @@ import com.kauailabs.navx.frc.AHRS;
import com.revrobotics.CANSparkMax;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.PneumaticsModuleType;
import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
@ -55,6 +56,10 @@ public void BrakeFerme(){
brakedroit.set(Value.kReverse);
brakegauche.set(Value.kReverse);
}
public void resetGyro(){
try {gyroscope.reset();} catch(Exception e){DriverStation.reportError("bye bye",true);
}
}
/** Creates a new BasePilotable. */
public BasePilotable() {
droit.setInverted(true);