grimpeur
This commit is contained in:
parent
353ea19d71
commit
c430c98e19
@ -22,6 +22,8 @@ import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||
|
||||
// Commands
|
||||
import frc.robot.command.Balayer;
|
||||
import frc.robot.command.GrimpeurDroit;
|
||||
import frc.robot.command.GrimpeurGauche;
|
||||
import frc.robot.command.GuiderBas;
|
||||
import frc.robot.command.GuiderHaut;
|
||||
import frc.robot.command.Lancer;
|
||||
@ -49,6 +51,8 @@ public class RobotContainer {
|
||||
GuiderBas guiderBas = new GuiderBas(guideur);
|
||||
LancerNote lancernote = new LancerNote(lanceur, accumulateur);
|
||||
Lancerampli lancerampli = new Lancerampli(lanceur);
|
||||
GrimpeurDroit grimpeurDroit = new GrimpeurDroit(grimpeur, null);
|
||||
GrimpeurGauche grimpeurGauche = new GrimpeurGauche(grimpeur, null);
|
||||
CommandJoystick joystick = new CommandJoystick(0);
|
||||
CommandXboxController manette = new CommandXboxController(1);
|
||||
|
||||
@ -69,7 +73,7 @@ public class RobotContainer {
|
||||
|
||||
private void configureBindings() {
|
||||
|
||||
joystick.button(3).toggleOnTrue(balayer);
|
||||
joystick.button(3).toggleOnTrue(balayer);
|
||||
|
||||
}
|
||||
|
||||
|
@ -4,13 +4,17 @@
|
||||
|
||||
package frc.robot.command;
|
||||
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystem.Grimpeur;
|
||||
|
||||
public class GrimpeurHautDroit extends Command {
|
||||
public class GrimpeurDroit extends Command {
|
||||
private DoubleSupplier doubleSupplier;
|
||||
private Grimpeur grimpeur;
|
||||
/** Creates a new GrimpeurHaut. */
|
||||
public GrimpeurHautDroit(Grimpeur grimpeur) {
|
||||
public GrimpeurDroit(Grimpeur grimpeur, DoubleSupplier doubleSupplier) {
|
||||
this.doubleSupplier = doubleSupplier;
|
||||
this.grimpeur = grimpeur;
|
||||
addRequirements(grimpeur);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
@ -31,11 +35,11 @@ public class GrimpeurHautDroit extends Command {
|
||||
grimpeur.droit(0);
|
||||
}
|
||||
else if(grimpeur.getpitch()<-15){
|
||||
grimpeur.droit(-0.6);
|
||||
grimpeur.droit(-doubleSupplier.getAsDouble());
|
||||
|
||||
}
|
||||
else if(grimpeur.getpitch()>15){
|
||||
grimpeur.droit(0.6);
|
||||
grimpeur.droit(doubleSupplier.getAsDouble());
|
||||
}
|
||||
else{
|
||||
grimpeur.droit(0);
|
@ -4,13 +4,17 @@
|
||||
|
||||
package frc.robot.command;
|
||||
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import frc.robot.subsystem.Grimpeur;
|
||||
|
||||
public class GrimpeurHautGauche extends Command {
|
||||
public class GrimpeurGauche extends Command {
|
||||
private DoubleSupplier doubleSupplier;
|
||||
private Grimpeur grimpeur;
|
||||
/** Creates a new GrimpeurHautGauche. */
|
||||
public GrimpeurHautGauche(Grimpeur grimpeur) {
|
||||
public GrimpeurGauche(Grimpeur grimpeur,DoubleSupplier doubleSupplier) {
|
||||
this.doubleSupplier = doubleSupplier;
|
||||
this.grimpeur = grimpeur;
|
||||
addRequirements(grimpeur);
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
@ -30,11 +34,11 @@ public class GrimpeurHautGauche extends Command {
|
||||
grimpeur.gauche(0);
|
||||
}
|
||||
else if(grimpeur.getpitch()<-15){
|
||||
grimpeur.gauche(0.6);
|
||||
grimpeur.gauche(doubleSupplier.getAsDouble());
|
||||
|
||||
}
|
||||
else if(grimpeur.getpitch()>15){
|
||||
grimpeur.gauche(-0.6);
|
||||
grimpeur.gauche(-doubleSupplier.getAsDouble());
|
||||
}
|
||||
else{
|
||||
grimpeur.gauche(0);
|
Loading…
x
Reference in New Issue
Block a user