This commit is contained in:
parent
e24e36486b
commit
bb4bee0d96
@ -14,10 +14,11 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
|
||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
|
||||
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.AvancerAuto;
|
||||
// Commands
|
||||
import frc.robot.command.Balayer;
|
||||
import frc.robot.command.GrimpeurDroit;
|
||||
@ -68,7 +69,7 @@ public class RobotContainer {
|
||||
GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, manette::getLeftY);
|
||||
GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, manette::getRightY);
|
||||
Debalayer debalayer = new Debalayer(balayeuse, accumulateur);
|
||||
|
||||
AvancerAuto avancerAuto = new AvancerAuto(drive);
|
||||
public RobotContainer() {
|
||||
|
||||
dashboard.addCamera("limelight", "limelight","limelight.local:5800")
|
||||
@ -115,6 +116,6 @@ public class RobotContainer {
|
||||
private void configureBindings() {}
|
||||
|
||||
public Command getAutonomousCommand(){
|
||||
return autoChooser.getSelected();
|
||||
return new SequentialCommandGroup(lancer.withTimeout(2),avancerAuto.withTimeout(3));
|
||||
}
|
||||
}
|
||||
|
40
src/main/java/frc/robot/command/AvancerAuto.java
Normal file
40
src/main/java/frc/robot/command/AvancerAuto.java
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc.robot.command;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystem.Drive;
|
||||
|
||||
public class AvancerAuto extends Command {
|
||||
private Drive drive;
|
||||
/** Creates a new AvancerAuto. */
|
||||
public AvancerAuto(Drive drive) {
|
||||
this.drive = drive;
|
||||
addRequirements(drive);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
}
|
||||
|
||||
// Called when the command is initially scheduled.
|
||||
@Override
|
||||
public void initialize() {}
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
drive.drive(0.5, 0, 0);
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
public void end(boolean interrupted) {
|
||||
drive.drive(0, 0, 0);
|
||||
}
|
||||
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user