From 2a5d7a1d21f77fa17ab2cd772e7ad8abfaee1003 Mon Sep 17 00:00:00 2001 From: EdwardFaucher Date: Tue, 29 Nov 2022 20:45:47 -0500 Subject: [PATCH] allo --- src/main/java/frc/robot/RobotContainer.java | 3 +-- src/main/java/frc/robot/subsystems/BasePilotable.java | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 18f6065..9a16371 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -20,7 +20,6 @@ import frc.robot.commands.Activer_poussoir; import frc.robot.commands.ActiverBlockeur; import frc.robot.commands.DesactiverBlockeur; import frc.robot.commands.Reculer; -import frc.robot.commands.ResetGyro; import frc.robot.commands.TournerDroite; import frc.robot.commands.TournerGauche; import frc.robot.commands.Activershaker; @@ -66,7 +65,7 @@ public class RobotContainer { */ private void configureButtonBindings() { JoystickButton buttonA = new JoystickButton(manette, XboxController.Button.kA.value); - buttonA.whileHeld(BoutonA); + buttonA.whileHeld(new); JoystickButton rightbumper = new JoystickButton(manette, XboxController.Button.kLeftBumper.value); rightbumper.whileHeld(Activershaker); JoystickButton buttonY = new JoystickButton(manette, XboxController.Button.kY.value); diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 9a85098..2994d77 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -9,6 +9,7 @@ import com.kauailabs.navx.frc.AHRS; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.drive.MecanumDrive; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; @@ -30,21 +31,23 @@ public double getangle() { return gyroscope.getAngle(); } public void drive(double y, double x, double rot){ - mecanum.driveCartesian(y, rot, x, -getangle()); + mecanum.driveCartesian(y, rot, -x, 0); } public void resetgyro(){ -try { gyroscope.reset(); } catch( Exception e) {DriverStation.reportError(e.getMessage(), true); } +try { gyroscope.reset(); } catch( Exception e) {DriverStation.reportError("bye bye", true); } } /** Creates a new BasePilotable. */ public BasePilotable() { avantDroit.setInverted(true); arriereDroit.setInverted(true); mecanum = new MecanumDrive(avantGauche, arriereGauche, avantDroit, arriereDroit); + mecanum.setDeadband(0.1); } @Override public void periodic() { // This method will be called once per scheduler run + SmartDashboard.putNumber("angle gyro" , getangle()); } }