bougie dans station pince
This commit is contained in:
		| @@ -97,7 +97,7 @@ public class RobotContainer { | ||||
|     SmartDashboard.putData("Auto Mode", autoChooser); | ||||
|     configureBindings(); | ||||
|     NamedCommands.registerCommand("AprilTag", new AprilTag3G(limelight3g, drivetrain, null, null)); | ||||
|     NamedCommands.registerCommand("Station",new StationPince(pince, elevateur)); | ||||
|     NamedCommands.registerCommand("Station",new StationPince(pince, elevateur,bougie)); | ||||
|     NamedCommands.registerCommand("L4", new L4(elevateur, pince)); | ||||
|     NamedCommands.registerCommand("L3", new L3(elevateur, pince)); | ||||
|     NamedCommands.registerCommand("CoralExpire",new CoralExpire(pince,bougie)); | ||||
| @@ -121,7 +121,7 @@ public class RobotContainer { | ||||
|  | ||||
|     //pince | ||||
|     manette1.rightTrigger().whileTrue(new CoralAlgueInspire(pince, bougie)); | ||||
|     manette1.rightBumper().whileTrue(new StationPince(pince, elevateur)); | ||||
|     manette1.rightBumper().whileTrue(new StationPince(pince, elevateur,bougie)); | ||||
|     manette1.leftTrigger().whileTrue(new AlgueExpire(pince, bougie)); | ||||
|     manette1.leftBumper().whileTrue(new AprilTag3G(limelight3g,drivetrain,manette1::getLeftX,manette1::getLeftY)); | ||||
|     manette1.povRight().whileTrue(new CoralExpire(pince, bougie)); | ||||
|   | ||||
| @@ -7,6 +7,7 @@ package frc.robot.commands.Elevateur; | ||||
| import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; | ||||
| import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab; | ||||
| import edu.wpi.first.wpilibj2.command.Command; | ||||
| import frc.robot.subsystems.Bougie; | ||||
| import frc.robot.subsystems.Elevateur; | ||||
| import frc.robot.subsystems.Pince; | ||||
|  | ||||
| @@ -15,11 +16,13 @@ public class StationPince extends Command { | ||||
|   ShuffleboardTab teb = Shuffleboard.getTab("teb"); | ||||
|   private Pince pince; | ||||
|   private Elevateur elevateur; | ||||
|   private Bougie bougie; | ||||
|   /** Creates a new L2Pince. */ | ||||
|   public StationPince(Pince pince,Elevateur elevateur) { | ||||
|   public StationPince(Pince pince,Elevateur elevateur, Bougie bougie) { | ||||
|     this.elevateur = elevateur; | ||||
|     this.pince = pince; | ||||
|     addRequirements(pince,elevateur); | ||||
|     this.bougie = bougie; | ||||
|     addRequirements(pince,elevateur, bougie); | ||||
|     // Use addRequirements() here to declare subsystem dependencies. | ||||
|   } | ||||
|  | ||||
| @@ -30,7 +33,13 @@ public class StationPince extends Command { | ||||
|   // Called every time the scheduler runs while the command is scheduled. | ||||
|   @Override | ||||
|   public void execute() { | ||||
|     pince.aspirecoral(0.5); | ||||
|     if(pince.emperagecoral() > 60){ | ||||
|       pince.aspirecoral(0);bougie.Bleu(); | ||||
|     } | ||||
|     else{ | ||||
|       pince.aspirecoral(0.5); | ||||
|     } | ||||
|      | ||||
|     if(pince.encodeurpivot()<=9.8 && pince.encodeurpivot()>=12){ | ||||
|       pince.pivote(0); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user