mode auto
This commit is contained in:
@ -4,8 +4,13 @@
|
||||
|
||||
package frc.robot;
|
||||
|
||||
import com.pathplanner.lib.auto.AutoBuilder;
|
||||
import com.pathplanner.lib.auto.NamedCommands;
|
||||
import com.pathplanner.lib.commands.PathPlannerAuto;
|
||||
|
||||
import edu.wpi.first.cameraserver.CameraServer;
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||
@ -19,7 +24,9 @@ import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import frc.robot.command.Balayer;
|
||||
import frc.robot.command.GuiderBas;
|
||||
import frc.robot.command.GuiderHaut;
|
||||
|
||||
import frc.robot.command.Lancer;
|
||||
import frc.robot.command.LancerNote;
|
||||
import frc.robot.command.Lancerampli;
|
||||
// Subsystems
|
||||
import frc.robot.subsystem.Accumulateur;
|
||||
import frc.robot.subsystem.Balayeuse;
|
||||
@ -30,7 +37,7 @@ import frc.robot.subsystem.Lanceur;
|
||||
|
||||
|
||||
public class RobotContainer {
|
||||
|
||||
private final SendableChooser<Command> autoChooser;
|
||||
Drive drive = new Drive();
|
||||
Accumulateur accumulateur = new Accumulateur();
|
||||
Balayeuse balayeuse = new Balayeuse();
|
||||
@ -40,11 +47,13 @@ public class RobotContainer {
|
||||
Balayer balayer = new Balayer(balayeuse, accumulateur);
|
||||
GuiderHaut guiderHaut = new GuiderHaut(guideur);
|
||||
GuiderBas guiderBas = new GuiderBas(guideur);
|
||||
|
||||
LancerNote lancernote = new LancerNote(lanceur, accumulateur);
|
||||
Lancerampli lancerampli = new Lancerampli(lanceur);
|
||||
CommandJoystick joystick = new CommandJoystick(0);
|
||||
CommandXboxController manette = new CommandXboxController(1);
|
||||
|
||||
public RobotContainer() {
|
||||
autoChooser = AutoBuilder.buildAutoChooser();
|
||||
|
||||
CameraServer.startAutomaticCapture();
|
||||
manette.a().onTrue(guiderBas);
|
||||
@ -53,6 +62,8 @@ public class RobotContainer {
|
||||
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));
|
||||
NamedCommands.registerCommand("balayer",balayer);
|
||||
NamedCommands.registerCommand("lancer", lancernote);
|
||||
}
|
||||
|
||||
private void configureBindings() {
|
||||
@ -62,6 +73,6 @@ public class RobotContainer {
|
||||
}
|
||||
|
||||
public Command getAutonomousCommand() {
|
||||
return new SequentialCommandGroup(null);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import frc.robot.subsystem.Lanceur;
|
||||
public class Lancer extends Command {
|
||||
/** Creates a new Lanceur. */
|
||||
private Lanceur lanceur;
|
||||
public Lancer() {
|
||||
public Lancer(Lanceur lanceur) {
|
||||
this.lanceur = lanceur;
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(lanceur);
|
||||
|
@ -15,7 +15,7 @@ public class Lancerampli extends Command {
|
||||
|
||||
private Lanceur lanceur;
|
||||
|
||||
public Lancerampli() {
|
||||
public Lancerampli(Lanceur lanceur) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(lanceur);
|
||||
this.lanceur = lanceur;
|
||||
|
Reference in New Issue
Block a user