mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-09 00:38:02 -06:00
Intergrate endefector into elevator for cordination
This commit is contained in:
@@ -49,7 +49,7 @@ import com.pathplanner.lib.commands.PathPlannerAuto;
|
||||
import frc4388.robot.subsystems.Vision;
|
||||
import frc4388.robot.subsystems.Lidar;
|
||||
import frc4388.robot.subsystems.Elevator;
|
||||
import frc4388.robot.subsystems.Endeffector;
|
||||
// import frc4388.robot.subsystems.Endeffector;
|
||||
import frc4388.robot.subsystems.SwerveDrive;
|
||||
|
||||
// Utilites
|
||||
@@ -74,8 +74,7 @@ public class RobotContainer {
|
||||
// private final LED m_robotLED = new LED();
|
||||
public final Vision m_vision = new Vision(m_robotMap.camera);
|
||||
public final Lidar m_lidar = new Lidar();
|
||||
public final Elevator m_robotELevator= new Elevator(m_robotMap.elevator);
|
||||
public final Endeffector m_robotEndeffector = new Endeffector(m_robotMap.endeffector);
|
||||
public final Elevator m_robotElevator= new Elevator(m_robotMap.elevator, m_robotMap.endeffector, m_robotMap.basinLimitSwitch, m_robotMap.endefectorLimitSwitch);
|
||||
public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.swerveDrivetrain, m_vision);
|
||||
// public final SwerveDrive m_robotSwerveDrive = new SwerveDrive(m_robotMap.swerveDrivetrain);
|
||||
|
||||
@@ -214,7 +213,20 @@ public class RobotContainer {
|
||||
|
||||
new JoystickButton(getDeadbandedDriverController(), XboxController.B_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> {}, m_robotSwerveDrive));
|
||||
// creates an empty command & requires the swerve drive, subsystems can run only 1 command at a time
|
||||
|
||||
|
||||
DualJoystickButton(getDeadbandedOperatorController(), getVirtualOperatorController(), XboxController.A_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotElevator.transitionWaiting(), m_robotElevator));
|
||||
|
||||
DualJoystickButton(getDeadbandedOperatorController(), getVirtualOperatorController(), XboxController.B_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotElevator.transitionReady(), m_robotElevator));
|
||||
|
||||
DualJoystickButton(getDeadbandedOperatorController(), getVirtualOperatorController(), XboxController.Y_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotElevator.transitionScoringThree(), m_robotElevator));
|
||||
|
||||
DualJoystickButton(getDeadbandedOperatorController(), getVirtualOperatorController(), XboxController.X_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotElevator.transitionScoringFour(), m_robotElevator));
|
||||
|
||||
|
||||
// ? /* Programer Buttons (Controller 3)*/
|
||||
|
||||
@@ -232,37 +244,6 @@ public class RobotContainer {
|
||||
true, false))
|
||||
.onFalse(new InstantCommand());
|
||||
|
||||
/*DPad for Level 1 and 2*/
|
||||
new Trigger(() -> getDeadbandedOperatorController().getRawAxis(XboxController.RIGHT_TRIGGER_AXIS) > 0.9)
|
||||
.onTrue(new InstantCommand(() -> m_robotELevator.PIDLevel2()))
|
||||
.onFalse(new InstantCommand(() -> m_robotELevator.elevatorStop()));
|
||||
|
||||
new Trigger(() -> getDeadbandedOperatorController().getRawAxis(XboxController.LEFT_TRIGGER_AXIS) > 0.9)
|
||||
.onTrue(new InstantCommand(() -> m_robotELevator.PIDLevel1()))
|
||||
.onFalse(new InstantCommand(() -> m_robotELevator.elevatorStop()));
|
||||
|
||||
/*Free Brid Mode With Bummpers*/
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.LEFT_BUMPER_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotELevator.elevatorDown()))
|
||||
.onFalse(new InstantCommand(() -> m_robotELevator.elevatorStop()));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.RIGHT_BUMPER_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotELevator.elevatorUp()))
|
||||
.onFalse(new InstantCommand(() -> m_robotELevator.elevatorStop()));
|
||||
|
||||
/*Endeffector Controls*/
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.Y_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotEndeffector.PIDTop()))
|
||||
.onFalse(new InstantCommand(() -> m_robotEndeffector.endEffectorStop()));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotEndeffector.PIDMiddle()))
|
||||
.onFalse(new InstantCommand(() -> m_robotEndeffector.endEffectorStop()));
|
||||
|
||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.A_BUTTON)
|
||||
.onTrue(new InstantCommand(() -> m_robotEndeffector.PIDBottom()))
|
||||
.onFalse(new InstantCommand(() -> m_robotEndeffector.endEffectorStop()));;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user