From 8da3ff39b2de78ad36c0c63cc05dac56007bda91 Mon Sep 17 00:00:00 2001 From: samuel desharnais Date: Wed, 12 Apr 2023 17:15:48 -0400 Subject: [PATCH] dhgvjb --- src/main/java/frc/robot/RobotContainer.java | 15 ++++++++------- src/main/java/frc/robot/commands/Avancer.java | 1 + src/main/java/frc/robot/commands/Reculer.java | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 4a6ba99..7273303 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -17,6 +17,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.Commands; 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.SequentialCommandGroup; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; @@ -67,6 +68,7 @@ public class RobotContainer { GenericEntry reculerdistances = layoutauto.addPersistent("reculerdistancesortir", -66).getEntry(); GenericEntry reculerdistanceb = layoutauto.addPersistent("reculerdistancebalance", -31).getEntry(); GenericEntry avancerdistance = layoutauto.addPersistent("avancer", 35).getEntry(); + GenericEntry avancerforce = layoutauto.addPersistent("avancerforce", 0.4).getEntry(); // subsystems BasePilotable basePilotable = new BasePilotable(); Gratte gratte = new Gratte(); @@ -148,17 +150,16 @@ public class RobotContainer { new SequentialCommandGroup( Commands.select(Map.ofEntries( Map.entry(enhaut, creerCommandBras(51, -40)), - Map.entry(aumilieux, creerCommandBras(9, -14)), - Map.entry(enbas, creerCommandBras(44, -17)), + Map.entry(aumilieux, creerCommandBras(45, -13)), + Map.entry(enbas, creerCommandBras(12, -9)), Map.entry(nulpart, creerCommandBras(0, 0))), chooser::getSelected), - creerCommandBras(49, -40).unless(() -> chooser.getSelected().equals(enhaut)), - creerCommandBras(51, -40).unless(() -> chooser.getSelected().equals(enhaut)), + //creerCommandBras(50, -40).unless(() -> !chooser.getSelected().equals(enhaut)), + //creerCommandBras(51, -40).unless(() -> !chooser.getSelected().equals(enhaut)), new OuvrePince(pince).unless(() -> chooser.getSelected().equals(nulpart)), Commands.waitSeconds(1), new FermePince(pince).unless(() -> chooser.getSelected().equals(nulpart)), - creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)), - Commands.waitSeconds(1), - Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true)), + new ParallelCommandGroup (creerCommandBras(0, 0).unless(() -> chooser.getSelected().equals(nulpart)), + Commands.either(reculers, reculerb, () -> autosortir.getBoolean(true))), new Avancer(basePilotable, () -> avancerdistance.getDouble(0)).unless(() -> !autosortir.getBoolean(true) || !autobalance.getBoolean(false)), Commands.either(gyro, Commands.none(), () -> autobalance.getBoolean(true)))) .andThen(brakeOuvre); diff --git a/src/main/java/frc/robot/commands/Avancer.java b/src/main/java/frc/robot/commands/Avancer.java index f7d37a1..c0cc3cf 100644 --- a/src/main/java/frc/robot/commands/Avancer.java +++ b/src/main/java/frc/robot/commands/Avancer.java @@ -7,6 +7,7 @@ package frc.robot.commands; import java.util.function.DoubleSupplier; +import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; import edu.wpi.first.wpilibj2.command.CommandBase; import frc.robot.subsystems.BasePilotable; diff --git a/src/main/java/frc/robot/commands/Reculer.java b/src/main/java/frc/robot/commands/Reculer.java index 903b216..51e81b2 100644 --- a/src/main/java/frc/robot/commands/Reculer.java +++ b/src/main/java/frc/robot/commands/Reculer.java @@ -30,7 +30,7 @@ public class Reculer extends CommandBase { // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - basePilotable.drive(-0.4,0); + basePilotable.drive(-0.45,0); } // Called once the command ends or is interrupted.