This commit is contained in:
2024-02-07 19:38:46 -05:00
11 changed files with 297 additions and 33 deletions

View File

@@ -19,7 +19,7 @@ import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
// Manettes
import edu.wpi.first.wpilibj2.command.button.CommandJoystick;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.command.AllumeLED;
// Commands
import frc.robot.command.Balayer;
import frc.robot.command.GrimpeurDroit;
@@ -35,7 +35,9 @@ import frc.robot.subsystem.Balayeuse;
import frc.robot.subsystem.Drive;
import frc.robot.subsystem.Grimpeur;
import frc.robot.subsystem.Guideur;
import frc.robot.subsystem.LED;
import frc.robot.subsystem.Lanceur;
import frc.robot.subsystem.Pixy;
public class RobotContainer {
@@ -57,25 +59,31 @@ public class RobotContainer {
//command
GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, manette::getLeftX);
GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getLeftY);
LED LED = new LED();
AllumeLED allumeLED = new AllumeLED(LED);
Pixy pixy = new Pixy();
public RobotContainer() {
NamedCommands.registerCommand("balayer",new Balayer(balayeuse, accumulateur));
NamedCommands.registerCommand("lancer", new LancerNote(lanceur, accumulateur));
autoChooser = AutoBuilder.buildAutoChooser();
CameraServer.startAutomaticCapture();
manette.a().onTrue(guiderBas);
manette.b().onTrue(guiderHaut);
manette.a().whileTrue(guiderBas);
manette.b().whileTrue(guiderHaut);
joystick.button(3).toggleOnTrue(balayer);
configureBindings();
drive.setDefaultCommand(new RunCommand(()->{
drive.drive(-MathUtil.applyDeadband(joystick.getY(),0.2), MathUtil.applyDeadband(-joystick.getX(),0.2), MathUtil.applyDeadband(-joystick.getZ(), 0.2));
},drive));
grimpeur.setDefaultCommand(new RunCommand(()->{
grimpeur.droit(manette.getLeftX());}
,grimpeur));
LED.setDefaultCommand(allumeLED);
}
private void configureBindings() {
joystick.button(3).toggleOnTrue(balayer);
}
public Command getAutonomousCommand(){