diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 43c48c1..de3edd1 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -12,6 +12,7 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; +import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; @@ -22,7 +23,6 @@ import frc.robot.subsystems.bras.BrasTelescopique; import frc.robot.subsystems.bras.Pince; import frc.robot.subsystems.bras.Pivot; import frc.robot.subsystems.Limelight; -import frc.robot.commands.Apriltag; // command import frc.robot.commands.BrakeFerme; import frc.robot.commands.BrakeOuvre; @@ -30,25 +30,17 @@ import frc.robot.commands.Cone; import frc.robot.commands.GratteBaisser; import frc.robot.commands.GratteMonte; import frc.robot.commands.Gyro; +import frc.robot.commands.Reculer; import frc.robot.commands.bras.FermePince; import frc.robot.commands.bras.OuvrePince; import frc.robot.commands.bras.PivotBrasRentre; import frc.robot.commands.bras.PivoteBrasBas; import frc.robot.commands.bras.PivoteBrasHaut; import frc.robot.commands.bras.PivoteBrasMilieux; -//subsystems -import frc.robot.commands.bras.PivotChercheBas; -import frc.robot.commands.bras.PivotChercheHaut; -import frc.robot.commands.Cube; -import frc.robot.commands.Tape; public class RobotContainer { -<<<<<<< HEAD -======= -//CameraServer.startAutomaticCapture(); ->>>>>>> fc4607f3c6d7203a155182eded4626d37f75de5e CommandXboxController manette1 = new CommandXboxController(0); CommandXboxController manette2 = new CommandXboxController(1); // subsystems @@ -57,7 +49,7 @@ Gratte gratte = new Gratte(); BrasTelescopique brasTelescopique = new BrasTelescopique(); Pince pince = new Pince(); Pivot pivot = new Pivot(); -Limelight limelight = new Limelight();/** */ +Limelight limelight = new Limelight(); //commands BrakeFerme brakeFerme = new BrakeFerme(basePilotable); BrakeOuvre brakeOuvre = new BrakeOuvre(basePilotable); @@ -81,12 +73,6 @@ String nulpart = "nul part"; ShuffleboardLayout layoutauto = Shuffleboard.getTab("teb").getLayout("auto"); GenericEntry autobalance = layoutauto.add("choix balance",true).getEntry(); GenericEntry autosortir = layoutauto.add("choix sorit",false).getEntry(); -PivotChercheBas pivotChercheBas = new PivotChercheBas(brasTelescopique, pivot); -PivotChercheHaut pivotChercheHaut = new PivotChercheHaut(brasTelescopique, pivot); -Cube cube = new Cube(limelight, basePilotable, null); -Apriltag aprilTag = new Apriltag(limelight, basePilotable, null); -Tape tape = new Tape(limelight, basePilotable, null); - public RobotContainer() { chooser.setDefaultOption(enhaut, enhaut); chooser.addOption(enbas, enbas); @@ -96,25 +82,16 @@ public RobotContainer() { configureBindings(); - CameraServer.startAutomaticCapture(); + basePilotable.setDefaultCommand(new RunCommand(() -> { - basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), 0); + basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX()); },basePilotable)); } - + private void configureBindings() { - basePilotable.setDefaultCommand(new RunCommand(() -> { - basePilotable.drive(-manette1.getLeftY(), -manette1.getLeftX(), 0); - },basePilotable)); - // manette 1 - manette1.povDown().onTrue(pivoteBrasHaut); - manette1.povUp().onTrue(pivoteBrasBas); - manette1.povLeft().onTrue(pivoteBrasMilieux); - manette1.povRight().onTrue(pivotBrasRentre); manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince)); manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable)); -<<<<<<< HEAD manette1.y().whileTrue(gyro); manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable)); /*manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte)); @@ -145,27 +122,5 @@ public RobotContainer() { ); -======= - manette1.b().onTrue(Commands.either(gratteBaisser, gratteMonte, gratte::getenHaut)); - manette1.leftBumper().toggleOnTrue(cube); - manette1.rightBumper().toggleOnTrue(cone); - // manette 2 - manette2.y().whileTrue(gyro); - manette2.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable)); - manette2.povRight().onTrue(pivotChercheBas); - manette2.povLeft().onTrue(pivotChercheHaut); - manette2.rightBumper().toggleOnTrue(aprilTag); - manette2.leftBumper().toggleOnTrue(tape); - } - - public Command getAutonomousCommand() { - return null; - //return new SequentialCommandGroup( - //new PivoteBrasMilieux(brasTelescopique, pivot), - //new OuvrePince(pince), - //new PivotBrasRentre(brasTelescopique, pivot).alongWith(new Reculer(basePilotable)), - //new Gyro(basePilotable) - //); ->>>>>>> fc4607f3c6d7203a155182eded4626d37f75de5e } } diff --git a/src/main/java/frc/robot/subsystems/BasePilotable.java b/src/main/java/frc/robot/subsystems/BasePilotable.java index cc90ca1..46ce7c2 100644 --- a/src/main/java/frc/robot/subsystems/BasePilotable.java +++ b/src/main/java/frc/robot/subsystems/BasePilotable.java @@ -80,4 +80,6 @@ public void BrakeFerme(){ public void periodic() { } +public void drive(double d, double leftX) { +} } diff --git a/src/main/java/frc/robot/subsystems/Gratte.java b/src/main/java/frc/robot/subsystems/Gratte.java index 8b0a9a2..877a104 100644 --- a/src/main/java/frc/robot/subsystems/Gratte.java +++ b/src/main/java/frc/robot/subsystems/Gratte.java @@ -13,7 +13,10 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import frc.robot.Constants; public class Gratte extends SubsystemBase { +<<<<<<< HEAD +======= +>>>>>>> aabe9b40ae896a36acdc9cd17a508016a3660a0a ShuffleboardTab teb = Shuffleboard.getTab("teb"); ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb") .getLayout("limitswitchsgratte", BuiltInLayouts.kList) diff --git a/src/main/java/frc/robot/subsystems/bras/Pivot.java b/src/main/java/frc/robot/subsystems/bras/Pivot.java index 082ce2b..0fe6788 100644 --- a/src/main/java/frc/robot/subsystems/bras/Pivot.java +++ b/src/main/java/frc/robot/subsystems/bras/Pivot.java @@ -14,7 +14,10 @@ import com.revrobotics.CANSparkMax; import com.revrobotics.CANSparkMaxLowLevel.MotorType; public class Pivot extends SubsystemBase { +<<<<<<< HEAD +======= +>>>>>>> aabe9b40ae896a36acdc9cd17a508016a3660a0a ShuffleboardTab teb = Shuffleboard.getTab("teb"); // moteur