fchgn
This commit is contained in:
parent
426d7e9885
commit
9a6c653c72
@ -12,10 +12,15 @@ import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
|
|||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
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.CommandXboxController;
|
||||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||||
import frc.robot.commands.Avancer;
|
import frc.robot.commands.Avancer;
|
||||||
import frc.robot.commands.Force1;
|
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.Force6;
|
||||||
import frc.robot.commands.Force7;
|
import frc.robot.commands.Force7;
|
||||||
import frc.robot.commands.Reculer;
|
import frc.robot.commands.Reculer;
|
||||||
@ -26,9 +31,15 @@ import frc.robot.subsystems.Lanceur;
|
|||||||
public class RobotContainer {
|
public class RobotContainer {
|
||||||
Lanceur lanceur = new Lanceur();
|
Lanceur lanceur = new Lanceur();
|
||||||
Accumulateur accumulateur = new Accumulateur();
|
Accumulateur accumulateur = new Accumulateur();
|
||||||
Force7 Force7 = new Force7(lanceur, null, accumulateur);
|
|
||||||
|
|
||||||
Force1 Force1 = new Force1(lanceur, accumulateur, null);
|
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");
|
ShuffleboardTab dashboard = Shuffleboard.getTab("Dashboard");
|
||||||
ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard")
|
ShuffleboardLayout forces = Shuffleboard.getTab("Dashboard")
|
||||||
.getLayout("limitswitchsgratte", BuiltInLayouts.kList)
|
.getLayout("limitswitchsgratte", BuiltInLayouts.kList)
|
||||||
@ -41,7 +52,7 @@ public class RobotContainer {
|
|||||||
GenericEntry force6 = forces.add("Force6", 0).getEntry();
|
GenericEntry force6 = forces.add("Force6", 0).getEntry();
|
||||||
GenericEntry force7 = forces.add("Force7", 0).getEntry();
|
GenericEntry force7 = forces.add("Force7", 0).getEntry();
|
||||||
CommandXboxController manette = new CommandXboxController(0);
|
CommandXboxController manette = new CommandXboxController(0);
|
||||||
Joystick joystick1 = new Joystick(0);
|
CommandJoystick joystick1 = new CommandJoystick(0);
|
||||||
Drive drive = new Drive();
|
Drive drive = new Drive();
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
|
|
||||||
@ -52,15 +63,17 @@ public class RobotContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void configureBindings() {
|
private void configureBindings() {
|
||||||
JoystickButton button7 = new JoystickButton(joystick1, 7);
|
joystick1.button(7).onTrue(Force1);
|
||||||
JoystickButton button8 = new JoystickButton(joystick1, 8);
|
joystick1.button(8).onTrue(Force2);
|
||||||
JoystickButton button9 = new JoystickButton(joystick1, 9);
|
joystick1.button(9).onTrue(Force3);
|
||||||
JoystickButton button10 = new JoystickButton(joystick1, 10);
|
joystick1.button(10).onTrue(Force4);
|
||||||
JoystickButton button11 = new JoystickButton(joystick1, 11);
|
joystick1.button(11).onTrue(Force5);
|
||||||
JoystickButton button12 = new JoystickButton(joystick1, 12);
|
joystick1.button(12).onTrue(Force6);
|
||||||
|
joystick1.button(3).onTrue(Force7);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur)
|
return new SequentialCommandGroup(new Avancer(drive), new Force7(lanceur, force7, accumulateur)
|
||||||
, new Force1(lanceur, accumulateur, force1), new Reculer(drive));
|
, new Force1(lanceur, accumulateur, force1), new Reculer(drive));
|
||||||
|
@ -25,7 +25,7 @@ public class Avancer extends CommandBase {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
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.
|
// Called once the command ends or is interrupted.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user