diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 20a459a..d9ff154 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -69,7 +69,7 @@ public RobotContainer() { 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.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte)); manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable)); } diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 6ed4487..5ec5abc 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -19,11 +19,11 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase; import frc.robot.Constants; public class BasePilotable extends SubsystemBase { - final CANSparkMax avantdroit = new CANSparkMax(Constants.avantdroit, MotorType.kBrushless); + final CANSparkMax avantd = new CANSparkMax(Constants.avantdroit, MotorType.kBrushless); final CANSparkMax avantgauche = new CANSparkMax(Constants.avantgauche, MotorType.kBrushless); final CANSparkMax arrieredroit = new CANSparkMax(Constants.arrieredroit, MotorType.kBrushless); final CANSparkMax arrieregauche = new CANSparkMax(Constants.arrieregauche, MotorType.kBrushless); - final MotorControllerGroup droit = new MotorControllerGroup(avantdroit, arrieredroit); + final MotorControllerGroup droit = new MotorControllerGroup(avantd, arrieredroit); final MotorControllerGroup gauche = new MotorControllerGroup(avantgauche, arrieregauche); final DifferentialDrive drive = new DifferentialDrive(gauche, droit); @@ -41,13 +41,13 @@ public class BasePilotable extends SubsystemBase { drive.arcadeDrive(xSpeed, zRotation); } public double distance(){ - return (-avantdroit.getEncoder().getPosition() + return (-avantd.getEncoder().getPosition() +avantgauche.getEncoder().getPosition() -arrieredroit.getEncoder().getPosition() +arrieregauche.getEncoder().getPosition()) / 4; } public void Reset() { - avantdroit.getEncoder().setPosition(0); + avantd.getEncoder().setPosition(0); avantgauche.getEncoder().setPosition(0); arrieredroit.getEncoder().setPosition(0); arrieregauche.getEncoder().setPosition(0);