diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index c04cf95..493cfbe 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -76,6 +76,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.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable)); manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte)); // manette 2 diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index 9a53bac..b628ceb 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); diff --git a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java index 94ed0f7..f606459 100644 --- a/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java +++ b/src/main/java/frc/robot/subsystems/bras/BrasTelescopique.java @@ -12,13 +12,18 @@ import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DoubleSolenoid; import edu.wpi.first.wpilibj.PneumaticsModuleType; import edu.wpi.first.wpilibj.DoubleSolenoid.Value; +import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; 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.wpilibj2.command.SubsystemBase; import frc.robot.Constants; public class BrasTelescopique extends SubsystemBase { ShuffleboardTab teb = Shuffleboard.getTab("teb"); + ShuffleboardLayout layout = Shuffleboard.getTab("teb") + .getLayout("layout", BuiltInLayouts.kList) + .withSize(2, 2); /** Creates a new BrasTelescopique. */ public BrasTelescopique() {} final CANSparkMax Winch = new CANSparkMax(Constants.BrasTelescopique,MotorType.kBrushless); @@ -44,9 +49,7 @@ public class BrasTelescopique extends SubsystemBase { } @Override public void periodic() { - teb .add("``photocell``",0.1); + teb .add("photocell",0.1); teb .add("winch",0.1); } - - -} +} \ No newline at end of file