dhgvjb
This commit is contained in:
parent
ba7d79882a
commit
8da3ff39b2
@ -17,6 +17,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
|
|||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.Commands;
|
import edu.wpi.first.wpilibj2.command.Commands;
|
||||||
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||||
|
import edu.wpi.first.wpilibj2.command.ParallelCommandGroup;
|
||||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||||
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
||||||
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||||
@ -67,6 +68,7 @@ public class RobotContainer {
|
|||||||
GenericEntry reculerdistances = layoutauto.addPersistent("reculerdistancesortir", -66).getEntry();
|
GenericEntry reculerdistances = layoutauto.addPersistent("reculerdistancesortir", -66).getEntry();
|
||||||
GenericEntry reculerdistanceb = layoutauto.addPersistent("reculerdistancebalance", -31).getEntry();
|
GenericEntry reculerdistanceb = layoutauto.addPersistent("reculerdistancebalance", -31).getEntry();
|
||||||
GenericEntry avancerdistance = layoutauto.addPersistent("avancer", 35).getEntry();
|
GenericEntry avancerdistance = layoutauto.addPersistent("avancer", 35).getEntry();
|
||||||
|
GenericEntry avancerforce = layoutauto.addPersistent("avancerforce", 0.4).getEntry();
|
||||||
// subsystems
|
// subsystems
|
||||||
BasePilotable basePilotable = new BasePilotable();
|
BasePilotable basePilotable = new BasePilotable();
|
||||||
Gratte gratte = new Gratte();
|
Gratte gratte = new Gratte();
|
||||||
@ -148,17 +150,16 @@ public class RobotContainer {
|
|||||||
new SequentialCommandGroup(
|
new SequentialCommandGroup(
|
||||||
Commands.select(Map.ofEntries(
|
Commands.select(Map.ofEntries(
|
||||||
Map.entry(enhaut, creerCommandBras(51, -40)),
|
Map.entry(enhaut, creerCommandBras(51, -40)),
|
||||||
Map.entry(aumilieux, creerCommandBras(9, -14)),
|
Map.entry(aumilieux, creerCommandBras(45, -13)),
|
||||||
Map.entry(enbas, creerCommandBras(44, -17)),
|
Map.entry(enbas, creerCommandBras(12, -9)),
|
||||||
Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected),
|
Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected),
|
||||||
creerCommandBras(49, -40).unless(() -> chooser.getSelected().equals(enhaut)),
|
//creerCommandBras(50, -40).unless(() -> !chooser.getSelected().equals(enhaut)),
|
||||||
creerCommandBras(51, -40).unless(() -> chooser.getSelected().equals(enhaut)),
|
//creerCommandBras(51, -40).unless(() -> !chooser.getSelected().equals(enhaut)),
|
||||||
new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
|
new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
|
||||||
Commands.waitSeconds(1),
|
Commands.waitSeconds(1),
|
||||||
new FermePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
|
new FermePince(pince).unless(() -> chooser.getSelected().equals(nulpart)),
|
||||||
creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)),
|
new ParallelCommandGroup (creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)),
|
||||||
Commands.waitSeconds(1),
|
Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true))),
|
||||||
Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true)),
|
|
||||||
new Avancer(basePilotable, () -> avancerdistance.getDouble(0)).unless(() -> !autosortir.getBoolean(true) || !autobalance.getBoolean(false)),
|
new Avancer(basePilotable, () -> avancerdistance.getDouble(0)).unless(() -> !autosortir.getBoolean(true) || !autobalance.getBoolean(false)),
|
||||||
Commands.either(gyro, Commands.none(), () -> autobalance.getBoolean(true))))
|
Commands.either(gyro, Commands.none(), () -> autobalance.getBoolean(true))))
|
||||||
.andThen(brakeOuvre);
|
.andThen(brakeOuvre);
|
||||||
|
@ -7,6 +7,7 @@ package frc.robot.commands;
|
|||||||
|
|
||||||
import java.util.function.DoubleSupplier;
|
import java.util.function.DoubleSupplier;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
|
||||||
import edu.wpi.first.wpilibj2.command.CommandBase;
|
import edu.wpi.first.wpilibj2.command.CommandBase;
|
||||||
import frc.robot.subsystems.BasePilotable;
|
import frc.robot.subsystems.BasePilotable;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class Reculer extends CommandBase {
|
|||||||
// Called every time the scheduler runs while the command is scheduled.
|
// Called every time the scheduler runs while the command is scheduled.
|
||||||
@Override
|
@Override
|
||||||
public void execute() {
|
public void execute() {
|
||||||
basePilotable.drive(-0.4,0);
|
basePilotable.drive(-0.45,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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