2023-01-16 18:10:02 -05:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
|
|
|
|
|
|
|
package frc.robot;
|
|
|
|
|
2023-02-15 18:56:04 -05:00
|
|
|
import edu.wpi.first.wpilibj.Joystick;
|
2023-02-15 18:20:54 -05:00
|
|
|
import edu.wpi.first.wpilibj.XboxController;
|
2023-01-16 18:10:02 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.Command;
|
|
|
|
import edu.wpi.first.wpilibj2.command.Commands;
|
2023-02-15 18:27:48 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.RunCommand;
|
2023-02-15 19:18:54 -05:00
|
|
|
<<<<<<< HEAD
|
2023-02-15 19:18:18 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
2023-02-15 18:56:04 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
2023-02-15 19:18:18 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.button.Trigger;
|
2023-02-15 19:18:35 -05:00
|
|
|
=======
|
|
|
|
<<<<<<< HEAD
|
2023-02-15 19:18:42 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup;
|
2023-02-15 19:18:54 -05:00
|
|
|
=======
|
2023-02-15 18:56:04 -05:00
|
|
|
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
2023-02-15 19:18:54 -05:00
|
|
|
>>>>>>> ded3f6018fe8a2c8b719139889c406330ff44003
|
2023-02-15 19:18:35 -05:00
|
|
|
>>>>>>> f1d0e3b3526aaeeafab0416ba8e92344786ea73c
|
2023-02-15 18:06:19 -05:00
|
|
|
//subsystems
|
2023-02-15 18:03:47 -05:00
|
|
|
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;
|
2023-02-15 18:06:19 -05:00
|
|
|
import frc.robot.subsystems.Limelight;
|
|
|
|
// command
|
2023-02-15 18:03:47 -05:00
|
|
|
import frc.robot.commands.BrakeFerme;
|
|
|
|
import frc.robot.commands.BrakeOuvre;
|
|
|
|
import frc.robot.commands.GratteBaisser;
|
|
|
|
import frc.robot.commands.GratteMonte;
|
|
|
|
import frc.robot.commands.Gyro;
|
2023-02-15 19:35:25 -05:00
|
|
|
import frc.robot.commands.Reculer;
|
2023-02-15 18:03:47 -05:00
|
|
|
import frc.robot.commands.bras.FermePince;
|
|
|
|
import frc.robot.commands.bras.OuvrePince;
|
|
|
|
import frc.robot.commands.bras.PivotBrasRentre;
|
|
|
|
import frc.robot.commands.bras.PivoteBrasBas;
|
|
|
|
import frc.robot.commands.bras.PivoteBrasHaut;
|
|
|
|
import frc.robot.commands.bras.PivoteBrasMilieux;
|
|
|
|
|
2023-01-16 18:10:02 -05:00
|
|
|
public class RobotContainer {
|
2023-02-15 18:20:54 -05:00
|
|
|
XboxController manette1 = new XboxController(0);
|
|
|
|
XboxController manette2 = new XboxController(1);
|
|
|
|
// subsystems
|
|
|
|
BasePilotable basePilotable = new BasePilotable();
|
|
|
|
Gratte gratte = new Gratte();
|
|
|
|
BrasTelescopique brasTelescopique = new BrasTelescopique();
|
|
|
|
Pince pince = new Pince();
|
|
|
|
Pivot pivot = new Pivot();
|
|
|
|
Limelight limelight = new Limelight();
|
|
|
|
//commands
|
|
|
|
BrakeFerme brakeFerme = new BrakeFerme(basePilotable);
|
|
|
|
BrakeOuvre brakeOuvre = new BrakeOuvre(basePilotable);
|
|
|
|
GratteBaisser gratteBaisser = new GratteBaisser(gratte);
|
|
|
|
GratteMonte gratteMonte = new GratteMonte(gratte);
|
|
|
|
Gyro gyro = new Gyro(basePilotable);
|
|
|
|
FermePince fermePince = new FermePince(pince);
|
|
|
|
OuvrePince ouvrePince = new OuvrePince(pince);
|
|
|
|
PivotBrasRentre pivotBrasRentre = new PivotBrasRentre(brasTelescopique, pivot);
|
|
|
|
PivoteBrasBas pivoteBrasBas = new PivoteBrasBas(brasTelescopique, pivot);
|
|
|
|
PivoteBrasMilieux pivoteBrasMilieux = new PivoteBrasMilieux(brasTelescopique, pivot);
|
|
|
|
PivoteBrasHaut pivoteBrasHaut = new PivoteBrasHaut(brasTelescopique, pivot);
|
|
|
|
|
|
|
|
public RobotContainer() {
|
2023-01-16 18:10:02 -05:00
|
|
|
configureBindings();
|
2023-02-15 18:27:48 -05:00
|
|
|
|
|
|
|
basePilotable.setDefaultCommand(brakeOuvre);
|
2023-02-15 19:18:18 -05:00
|
|
|
basePilotable.drive(-manette1.getLeftY(), manette1.getLeftX(), -manette1.getLeftTriggerAxis()+manette1.getRightTriggerAxis());
|
2023-02-15 18:35:35 -05:00
|
|
|
}
|
|
|
|
|
2023-01-16 18:10:02 -05:00
|
|
|
|
2023-02-15 18:56:04 -05:00
|
|
|
private void configureBindings() {
|
2023-02-15 19:18:18 -05:00
|
|
|
XboxController exampleController = new XboxController(2);
|
|
|
|
Trigger aButton = new JoystickButton(exampleController, XboxController.Button.kY.value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-15 18:56:04 -05:00
|
|
|
|
|
|
|
}
|
2023-01-16 18:10:02 -05:00
|
|
|
|
|
|
|
public Command getAutonomousCommand() {
|
|
|
|
return Commands.print("No autonomous command configured");
|
2023-02-15 19:35:25 -05:00
|
|
|
return new SequentialCommandGroup(
|
|
|
|
new PivoteBrasMilieux(brasTelescopique, pivot),
|
|
|
|
new OuvrePince(pince),
|
|
|
|
new PivotBrasRentre(brasTelescopique, pivot).alongWith(new Reculer(basePilotable)),
|
|
|
|
new Gyro(basePilotable)
|
|
|
|
);
|
2023-01-16 18:10:02 -05:00
|
|
|
}
|
|
|
|
}
|