diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 83534a3..da51045 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -92,21 +92,7 @@ public class RobotContainer { */ public Command getAutonomousCommand() { // An ExampleCommand will run in autonomous - return null; - /**( - new Reculer(basePilotable).withTimeout(SmartDashboard.getNumber("temps reculer", 1)), - new TournerGauche(basePilotable).withTimeout(SmartDashboard.getNumber("temps tourne gauche1",1)), - new Avancer(basePilotable).withTimeout(SmartDashboard.getNumber("temps avencer1",1)), - new TournerDroite(basePilotable).withTimeout(SmartDashboard.getNumber("temps tourne droite1",1)), - new Avancer(basePilotable).withTimeout(SmartDashboard.getNumber("temps avancer2",1)), - new TournerGauche(basePilotable).withTimeout(SmartDashboard.getNumber("temps tourne gauche2",1)), - new Avancer(basePilotable).withTimeout(SmartDashboard.getNumber("temps avancer3",1)), - new TournerDroite(basePilotable).withTimeout(SmartDashboard.getNumber("temps tourne droite 2",1)), - new Avancer(basePilotable).withTimeout(SmartDashboard.getNumber("temps avancer4",1)), - new DesactiverBlockeur(poussoir).withTimeout(SmartDashboard.getNumber("temps du b1",0.8)), - new Activer_poussoir(poussoir).withTimeout(SmartDashboard.getNumber("temps pousser1",1)), - new Activershaker(pistonshaker).withTimeout(SmartDashboard.getNumber("temps du b2",1)), - new Activer_poussoir(poussoir).withTimeout(SmartDashboard.getNumber("temps pousser2",1))); */ - + return new Avancer(basePilotable, SmartDashboard.getNumber("AvancerVit",0)).withTimeout(SmartDashboard.getNumber("avancer", 1)); + } } diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index b669a57..3a6c415 100644 --- a/src/main/java/frc/robot/commands/Avancer.java +++ b/src/main/java/frc/robot/commands/Avancer.java @@ -9,9 +9,11 @@ import frc.robot.subsystems.BasePilotable; public class Avancer extends CommandBase { private BasePilotable basePilotable; + private double vitesse; /** Creates a new Avancer. */ - public Avancer(BasePilotable basePilotable) { - basePilotable = new BasePilotable(); + public Avancer(BasePilotable basePilotable, double vitesse) { + this.basePilotable = basePilotable; + this.vitesse = vitesse; // Use addRequirements() here to declare subsystem dependencies. addRequirements(basePilotable); } @@ -23,7 +25,8 @@ public class Avancer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(0.5, 0.5, 0); + basePilotable.drive(vitesse, 0, 0); + } // Called once the command ends or is interrupted.