code mieux
This commit is contained in:
parent
1627770572
commit
0be9356fa9
@ -20,6 +20,7 @@ import frc.robot.commands.ElevateurManuel;
|
||||
import frc.robot.commands.L2;
|
||||
import frc.robot.commands.L3;
|
||||
import frc.robot.commands.L4;
|
||||
import frc.robot.commands.PinceManuel;
|
||||
import frc.robot.commands.StationPince;
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
@ -32,11 +33,15 @@ public class RobotContainer {
|
||||
Pince pince = new Pince();
|
||||
Elevateur elevateur = new Elevateur();
|
||||
ElevateurManuel elevateurManuel = new ElevateurManuel(elevateur, manette2::getLeftY);
|
||||
PinceManuel pinceManuel = new PinceManuel(pince, manette2::getRightY);
|
||||
public RobotContainer() {
|
||||
configureBindings();
|
||||
elevateur.setDefaultCommand(new RunCommand(()->{
|
||||
elevateur.vitesse(MathUtil.applyDeadband(manette2.getLeftY(), 0.2));
|
||||
}, elevateur));
|
||||
pince.setDefaultCommand(new RunCommand(()->{
|
||||
pince.pivote(MathUtil.applyDeadband(manette2.getRightY(), 0.2));
|
||||
}, pince));
|
||||
NamedCommands.registerCommand("Station",new StationPince(pince, elevateur));
|
||||
NamedCommands.registerCommand("L4", new L4(elevateur, pince));
|
||||
NamedCommands.registerCommand("L3", new L3(elevateur, pince));
|
||||
|
@ -5,7 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
package frc.robot.commands;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystems.Bougie;
|
||||
|
||||
import frc.robot.subsystems.Elevateur;
|
||||
import frc.robot.subsystems.Pince;
|
||||
|
||||
|
@ -27,7 +27,14 @@ public class PinceManuel extends Command {
|
||||
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {}
|
||||
public void execute() {
|
||||
if(pince.position()){
|
||||
pince.pivote(0);
|
||||
}
|
||||
else{
|
||||
pince.pivote(doubleSupplier.getAsDouble());
|
||||
}
|
||||
}
|
||||
|
||||
// Called once the command ends or is interrupted.
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user