tfghjkm
This commit is contained in:
parent
cd7604e30f
commit
64556db1cd
@ -18,6 +18,7 @@ import frc.robot.subsystems.bras.Pince;
|
|||||||
import frc.robot.subsystems.bras.Pivot;
|
import frc.robot.subsystems.bras.Pivot;
|
||||||
import pabeles.concurrency.ConcurrencyOps.Reset;
|
import pabeles.concurrency.ConcurrencyOps.Reset;
|
||||||
import frc.robot.subsystems.Limelight;
|
import frc.robot.subsystems.Limelight;
|
||||||
|
import frc.robot.commands.Apriltag;
|
||||||
// command
|
// command
|
||||||
import frc.robot.commands.BrakeFerme;
|
import frc.robot.commands.BrakeFerme;
|
||||||
import frc.robot.commands.BrakeOuvre;
|
import frc.robot.commands.BrakeOuvre;
|
||||||
@ -35,6 +36,7 @@ import frc.robot.commands.bras.PivoteBrasMilieux;
|
|||||||
import frc.robot.commands.bras.PivotChercheBas;
|
import frc.robot.commands.bras.PivotChercheBas;
|
||||||
import frc.robot.commands.bras.PivotChercheHaut;
|
import frc.robot.commands.bras.PivotChercheHaut;
|
||||||
import edu.wpi.first.apriltag.AprilTag;
|
import edu.wpi.first.apriltag.AprilTag;
|
||||||
|
import edu.wpi.first.math.spline.CubicHermiteSpline;
|
||||||
import frc.robot.commands.Cube;
|
import frc.robot.commands.Cube;
|
||||||
import frc.robot.commands.Cone;
|
import frc.robot.commands.Cone;
|
||||||
import frc.robot.commands.Tape;
|
import frc.robot.commands.Tape;
|
||||||
@ -62,6 +64,12 @@ PivoteBrasBas pivoteBrasBas = new PivoteBrasBas(brasTelescopique, pivot);
|
|||||||
PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pivot);
|
PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pivot);
|
||||||
PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot);
|
PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot);
|
||||||
Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY());
|
Cone cone = new Cone(limelight, basePilotable, ()->-manette1.getLeftY());
|
||||||
|
PivotChercheBas pivotChercheBas = new PivotChercheBas(brasTelescopique, pivot);
|
||||||
|
PivotChercheHaut pivotChercheHaut = new PivotChercheHaut(brasTelescopique, pivot);
|
||||||
|
Cube cube = new Cube(limelight, basePilotable, null);
|
||||||
|
Apriltag aprilTag = new Apriltag(limelight, basePilotable, null);
|
||||||
|
Tape tape = new Tape(limelight, basePilotable, null);
|
||||||
|
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
configureBindings();
|
configureBindings();
|
||||||
|
|
||||||
@ -71,23 +79,24 @@ public RobotContainer() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean configureBindings() {
|
private void configureBindings() {
|
||||||
// manette 1
|
// manette 1
|
||||||
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
|
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
|
||||||
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
|
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
|
||||||
manette1.y().whileTrue(gyro);
|
manette1.y().whileTrue(gyro);
|
||||||
manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable));
|
manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable));
|
||||||
manette1.b().toggleOnTrue(Commands.startEnd(gratte::baiser, gratte::Lever,gratte));
|
manette1.b().onTrue(Commands.either(gratteBaisser, gratteMonte, gratte::getenHaut));
|
||||||
|
manette1.leftBumper().toggleOnTrue(aprilTag);
|
||||||
|
manette1.rightBumper().toggleOnTrue(tape);
|
||||||
// manette 2
|
// manette 2
|
||||||
manette2.a().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasHaut, brasTelescopique::pivoteBrasHaut, brasTelescopique));
|
manette2.a().onTrue(pivoteBrasHaut);
|
||||||
manette2.b().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasBas, brasTelescopique::pivoteBrasBas, brasTelescopique));
|
manette2.b().onTrue(pivoteBrasBas);
|
||||||
manette2.x().toggleOnTrue(Commands.startEnd(brasTelescopique::pivoteBrasMilieux, brasTelescopique::pivoteBrasMilieux, brasTelescopique));
|
manette2.x().onTrue(pivoteBrasMilieux);
|
||||||
manette2.y().toggleOnTrue(Commands.startEnd(brasTelescopique::pivotBrasRentre, brasTelescopique::pivotBrasRentre, brasTelescopique));
|
manette2.y().onTrue(pivotBrasRentre);
|
||||||
manette2.povRight().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheBas, brasTelescopique::PivotChercheBas, brasTelescopique));
|
manette2.povRight().onTrue(pivotChercheBas);
|
||||||
manette2.povLeft().toggleOnTrue(Commands.startEnd(brasTelescopique::PivotChercheHaut, brasTelescopique::PivotChercheHaut, brasTelescopique));
|
manette2.povLeft().onTrue(pivotChercheHaut);
|
||||||
manette2.rightBumper().toggleOnTrue(Commands.startEnd(null, null, null));
|
manette2.rightBumper().toggleOnTrue(cube);
|
||||||
manette2.leftBumper().toggleOnTrue(Commands.startEnd(null, null, null));
|
manette2.leftBumper().toggleOnTrue(cone);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
|
@ -18,7 +18,9 @@ public class GratteBaisser extends CommandBase {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
gratte.setenHaut(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
@ -41,9 +43,7 @@ public class GratteBaisser extends CommandBase {
|
|||||||
|
|
||||||
// Called once the command ends or is interrupted.
|
// Called once the command ends or is interrupted.
|
||||||
@Override
|
@Override
|
||||||
public void end(boolean interrupted) {
|
public void end(boolean interrupted) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Returns true when the command should end.
|
// Returns true when the command should end.
|
||||||
@Override
|
@Override
|
||||||
|
@ -19,7 +19,9 @@ public class GratteMonte extends CommandBase {
|
|||||||
|
|
||||||
// Called when the command is initially scheduled.
|
// Called when the command is initially scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {}
|
public void initialize() {
|
||||||
|
gratte.setenHaut(true);
|
||||||
|
}
|
||||||
|
|
||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
|
@ -5,6 +5,11 @@
|
|||||||
package frc.robot.subsystems;
|
package frc.robot.subsystems;
|
||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
|
||||||
|
import javax.swing.text.StyledEditorKit.BoldAction;
|
||||||
|
|
||||||
|
import org.apache.commons.collections4.functors.IfClosure;
|
||||||
|
|
||||||
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
|
||||||
import edu.wpi.first.wpilibj.DigitalInput;
|
import edu.wpi.first.wpilibj.DigitalInput;
|
||||||
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||||
@ -25,8 +30,16 @@ ShuffleboardLayout limitswitchgratte = Shuffleboard.getTab("teb")
|
|||||||
private DigitalInput limithg = new DigitalInput(Constants.limithg);
|
private DigitalInput limithg = new DigitalInput(Constants.limithg);
|
||||||
private DigitalInput limitbd = new DigitalInput(Constants.limitbd);
|
private DigitalInput limitbd = new DigitalInput(Constants.limitbd);
|
||||||
private DigitalInput limitbg = new DigitalInput(Constants.limitbg);
|
private DigitalInput limitbg = new DigitalInput(Constants.limitbg);
|
||||||
public boolean baiser;
|
public boolean baiser;
|
||||||
|
boolean enHaut = true;
|
||||||
|
public void setenHaut(boolean enHaut){
|
||||||
|
this.enHaut = enHaut;
|
||||||
|
}
|
||||||
|
public boolean getenHaut(){
|
||||||
|
return enHaut;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hautd(){
|
public boolean hautd(){
|
||||||
return limithd.get();
|
return limithd.get();
|
||||||
}
|
}
|
||||||
@ -35,14 +48,19 @@ public boolean baiser;
|
|||||||
return limithg.get();
|
return limithg.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean basd(int i, String string){
|
public boolean basd(){
|
||||||
return limitbd.get();
|
return limitbd.get();
|
||||||
}
|
}
|
||||||
public boolean basg(){
|
public boolean basg(){
|
||||||
return limitbg.get();
|
return limitbg.get();
|
||||||
}
|
}
|
||||||
/** Creates a new Gratte. */
|
/** Creates a new Gratte. */
|
||||||
public Gratte() {}
|
public Gratte() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void Lever(double vitesse){
|
public void Lever(double vitesse){
|
||||||
Gratted.set(vitesse);
|
Gratted.set(vitesse);
|
||||||
Gratteg.set(vitesse);
|
Gratteg.set(vitesse);
|
||||||
@ -52,18 +70,10 @@ public boolean baiser;
|
|||||||
Gratteg.set(-vitesse);
|
Gratteg.set(-vitesse);
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void periodic() {
|
public void periodic(){
|
||||||
teb .add("limithd", 0.1);
|
|
||||||
teb .add("limithg", 0.1);
|
|
||||||
teb .add("limitbd", 0.1);
|
|
||||||
teb .add("limitbg", 0.1);
|
|
||||||
limitswitchgratte.add ("limitbd", 0.1);
|
limitswitchgratte.add ("limitbd", 0.1);
|
||||||
limitswitchgratte.add ("limithg", 0.1);
|
limitswitchgratte.add ("limithg", 0.1);
|
||||||
limitswitchgratte.add ("limithd", 0.1);
|
limitswitchgratte.add ("limithd", 0.1);
|
||||||
limitswitchgratte.add ("limitbg", 0.1);
|
limitswitchgratte.add ("limitbg", 0.1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public boolean basd() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user