pince mieux
This commit is contained in:
parent
ee2c9ff4b2
commit
b384585224
@ -48,7 +48,7 @@ public class RobotContainer {
|
|||||||
manette1.povDown().toggleOnTrue(new Depart(elevateur, pince));
|
manette1.povDown().toggleOnTrue(new Depart(elevateur, pince));
|
||||||
//manette2
|
//manette2
|
||||||
manette2.leftBumper().toggleOnTrue(new DepartPince(pince));
|
manette2.leftBumper().toggleOnTrue(new DepartPince(pince));
|
||||||
manette2.a().whileTrue(new StationPince(pince));
|
manette2.a().whileTrue(new StationPince(pince,elevateur));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
|
@ -5,15 +5,18 @@
|
|||||||
package frc.robot.command;
|
package frc.robot.command;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import frc.robot.subsystems.Elevateur;
|
||||||
import frc.robot.subsystems.Pince;
|
import frc.robot.subsystems.Pince;
|
||||||
|
|
||||||
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
|
||||||
public class StationPince extends Command {
|
public class StationPince extends Command {
|
||||||
private Pince pince;
|
private Pince pince;
|
||||||
|
private Elevateur elevateur;
|
||||||
/** Creates a new L2Pince. */
|
/** Creates a new L2Pince. */
|
||||||
public StationPince(Pince pince) {
|
public StationPince(Pince pince,Elevateur elevateur) {
|
||||||
|
this.elevateur = elevateur;
|
||||||
this.pince = pince;
|
this.pince = pince;
|
||||||
addRequirements(pince);
|
addRequirements(pince,elevateur);
|
||||||
// Use addRequirements() here to declare subsystem dependencies.
|
// Use addRequirements() here to declare subsystem dependencies.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,6 +36,15 @@ public class StationPince extends Command {
|
|||||||
else{
|
else{
|
||||||
pince.pivote(0.5);
|
pince.pivote(0.5);
|
||||||
}
|
}
|
||||||
|
if(elevateur.position()>=400 && elevateur.position()<=410){
|
||||||
|
elevateur.vitesse(0);
|
||||||
|
}
|
||||||
|
else if(elevateur.position()>=510){
|
||||||
|
elevateur.vitesse(-0.3);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
elevateur.vitesse(.3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user