mode auto manuel
This commit is contained in:
@@ -28,8 +28,10 @@ import edu.wpi.first.wpilibj2.command.Commands;
|
||||
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||
import edu.wpi.first.wpilibj2.command.WaitUntilCommand;
|
||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
import frc.robot.TunerConstants.TunerConstants;
|
||||
import frc.robot.commands.AvancerAuto;
|
||||
import frc.robot.commands.RainBow;
|
||||
import frc.robot.commands.reset;
|
||||
import frc.robot.commands.Elevateur.Depart;
|
||||
@@ -177,14 +179,19 @@ public class RobotContainer {
|
||||
}
|
||||
|
||||
public Command getAutonomousCommand() {
|
||||
return new SequentialCommandGroup(Commands.runOnce(()->{
|
||||
boolean flip = DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red;
|
||||
if(flip){
|
||||
drivetrain.resetPose(FlippingUtil.flipFieldPose(((PathPlannerAuto)autoChooser.getSelected()).getStartingPose()));
|
||||
}
|
||||
else{
|
||||
drivetrain.resetPose(((PathPlannerAuto)autoChooser.getSelected()).getStartingPose());
|
||||
}
|
||||
}),autoChooser.getSelected(), new RainBow(bougie));
|
||||
return new SequentialCommandGroup(
|
||||
new AvancerAuto(drive).withTimeout(2),
|
||||
new L1Requin(requin, bougie).withTimeout(2),
|
||||
new ExpireCorail(requin, bougie).withTimeout(2),
|
||||
new RainBow(bougie));
|
||||
// return new SequentialCommandGroup(Commands.runOnce(()->{
|
||||
// boolean flip = DriverStation.getAlliance().orElse(Alliance.Blue) == Alliance.Red;
|
||||
// if(flip){
|
||||
// drivetrain.resetPose(FlippingUtil.flipFieldPose(((PathPlannerAuto)autoChooser.getSelected()).getStartingPose()));
|
||||
// }
|
||||
// else{
|
||||
// drivetrain.resetPose(((PathPlannerAuto)autoChooser.getSelected()).getStartingPose());
|
||||
// }
|
||||
// }),autoChooser.getSelected(), new RainBow(bougie));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user