This commit is contained in:
EdwardFaucher 2023-03-11 10:14:18 -05:00
parent 77b39f47a4
commit de5b5213cb

View File

@ -3,34 +3,21 @@
// the WPILib BSD license file in the root directory of this project.
package frc.robot;
import org.photonvision.estimation.CameraTargetRelation;
import java.util.Map;
import edu.wpi.first.cameraserver.CameraServer;
<<<<<<< HEAD
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts;
import edu.wpi.first.wpilibj.shuffleboard.BuiltInWidgets;
=======
>>>>>>> feb8cc033e5eefa2d6b104c4ab7de16e0527fc5f
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import java.util.Map;
import edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardLayout;
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.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.InstantCommand;
import edu.wpi.first.wpilibj2.command.RunCommand;
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
//subsystems
import frc.robot.subsystems.BasePilotable;
import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot;
import frc.robot.subsystems.Limelight;
import frc.robot.commands.Apriltag;
import frc.robot.commands.Avancer;
// command
@ -51,6 +38,13 @@ import frc.robot.commands.bras.PivotChercheHaut;
import frc.robot.commands.bras.PivoteBrasBas;
import frc.robot.commands.bras.PivoteBrasHaut;
import frc.robot.commands.bras.PivoteBrasMilieux;
//subsystems
import frc.robot.subsystems.BasePilotable;
import frc.robot.subsystems.Gratte;
import frc.robot.subsystems.Limelight;
import frc.robot.subsystems.bras.BrasTelescopique;
import frc.robot.subsystems.bras.Pince;
import frc.robot.subsystems.bras.Pivot;
public class RobotContainer {
@ -117,16 +111,22 @@ public RobotContainer() {
}
private void configureBindings() {
// manette 1
manette1.povDown().onTrue(pivoteBrasHaut);
manette1.povUp().onTrue(pivoteBrasBas);
manette1.povLeft().onTrue(pivoteBrasMilieux);
manette1.povRight().onTrue(pivotBrasRentre);
manette1.a().toggleOnTrue(Commands.startEnd(pince::ouvrir, pince::fermer,pince));
manette1.x().toggleOnTrue(Commands.startEnd(basePilotable::BrakeFerme,basePilotable::BrakeOuvre,basePilotable));
manette1.y().whileTrue(gyro);
manette1.start().toggleOnTrue(Commands.startEnd(basePilotable::resetGyro, basePilotable::resetGyro, basePilotable));
manette1.leftBumper().toggleOnTrue(aprilTag);
manette1.rightBumper().toggleOnTrue(tape);
manette1.povUp().onTrue(pivoteBrasHaut);
manette1.povDown().onTrue(pivoteBrasBas);
manette1.povRight().onTrue(pivoteBrasMilieux);
manette1.povLeft().onTrue(pivotBrasRentre);
//manette 2
manette2.povRight().onTrue(pivotChercheBas);
manette2.povLeft().onTrue(pivotChercheHaut);
manette2.rightBumper().toggleOnTrue(cube);
manette2.leftBumper().toggleOnTrue(cone);
manette2.y().whileTrue(gyro);
manette2.start().onTrue(new InstantCommand(basePilotable::resetGyro));
manette2.b().onTrue(Commands.either(gratteBaisser, gratteMonte, gratte::getenHaut));
}
public Command getAutonomousCommand() {
@ -143,7 +143,7 @@ public RobotContainer() {
Commands.either(reculers, reculerb,()-> autosortir.getBoolean(true)),
avancer.unless(()->!autosortir.getBoolean(true)|| !autobalance.getBoolean(false)),
Commands.either(gyro, Commands.none(),()-> autobalance.getBoolean(true))
);
).deadlineWith(Commands.waitSeconds(14)).andThen(brakeOuvre);
}