diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 3719816..af35985 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -12,10 +12,15 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.RunCommand; import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; +import edu.wpi.first.wpilibj2.command.button.CommandJoystick; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import edu.wpi.first.wpilibj2.command.button.JoystickButton; import frc.robot.commands.Avancer; import frc.robot.commands.Force1; +import frc.robot.commands.Force2; +import frc.robot.commands.Force3; +import frc.robot.commands.Force4; +import frc.robot.commands.Force5; import frc.robot.commands.Force6; import frc.robot.commands.Force7; import frc.robot.commands.Reculer; @@ -26,9 +31,15 @@ import frc.robot.subsystems.Lanceur; public class RobotContainer { Lanceur lanceur = new Lanceur(); Accumulateur accumulateur = new Accumulateur(); - Force7 Force7 = new Force7(lanceur, null, accumulateur); + Force1 Force1 = new Force1(lanceur, accumulateur, null); + Force2 Force2 = new Force2(lanceur, accumulateur, null); + Force3 Force3 = new Force3(lanceur, null, accumulateur); + Force4 Force4 = new Force4(lanceur, null, accumulateur); + Force5 Force5 = new Force5(lanceur, null, accumulateur); + Force6 Force6 = new Force6(lanceur, null, accumulateur); + Force7 Force7 = new Force7(lanceur, null, accumulateur); ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard"); ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard") .getLayout("limitswitchsgratte", BuiltInLayouts.kList) @@ -41,7 +52,7 @@ public class RobotContainer { GenericEntry force6 = forces.add("Force6", 0).getEntry(); GenericEntry force7 = forces.add("Force7", 0).getEntry(); CommandXboxController manette = new CommandXboxController(0); - Joystick joystick1 = new Joystick(0); + CommandJoystick joystick1 = new CommandJoystick(0); Drive drive = new Drive(); public RobotContainer() { @@ -52,15 +63,17 @@ public class RobotContainer { } private void configureBindings() { - JoystickButton button7 = new JoystickButton(joystick1, 7); - JoystickButton button8 = new JoystickButton(joystick1, 8); - JoystickButton button9 = new JoystickButton(joystick1, 9); - JoystickButton button10 = new JoystickButton(joystick1, 10); - JoystickButton button11 = new JoystickButton(joystick1, 11); - JoystickButton button12 = new JoystickButton(joystick1, 12); + joystick1.button(7).onTrue(Force1); + joystick1.button(8).onTrue(Force2); + joystick1.button(9).onTrue(Force3); + joystick1.button(10).onTrue(Force4); + joystick1.button(11).onTrue(Force5); + joystick1.button(12).onTrue(Force6); + joystick1.button(3).onTrue(Force7); + } - + public Command getAutonomousCommand() { return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur) , new Force1(lanceur, accumulateur, force1), new Reculer(drive)); diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index 9cebc32..00286c4 100644 --- a/src/main/java/frc/robot/commands/Avancer.java +++ b/src/main/java/frc/robot/commands/Avancer.java @@ -25,7 +25,7 @@ public class Avancer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - drive.drive(0.5, 0.2, 0); + drive.drive(0.5, 0.2, 0); } // Called once the command ends or is interrupted.