mirror of
https://github.com/Team4388/Robot-Electronics-Test.git
synced 2026-06-08 16:28:00 -06:00
Update RobotContainer.java
This commit is contained in:
@@ -13,7 +13,7 @@ import edu.wpi.first.wpilibj2.command.InstantCommand;
|
||||
import edu.wpi.first.wpilibj2.command.RunCommand;
|
||||
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
|
||||
import frc4388.robot.Constants.*;
|
||||
import frc4388.robot.subsystems.Drive;
|
||||
import frc4388.robot.subsystems.FalconTester;
|
||||
import frc4388.robot.subsystems.LED;
|
||||
import frc4388.utility.LEDPatterns;
|
||||
import frc4388.utility.controller.IHandController;
|
||||
@@ -31,11 +31,11 @@ public class RobotContainer {
|
||||
private final RobotMap m_robotMap = new RobotMap();
|
||||
|
||||
/* Subsystems */
|
||||
private final Drive m_robotDrive = new Drive(m_robotMap.leftFrontMotor, m_robotMap.rightFrontMotor,
|
||||
m_robotMap.leftBackMotor, m_robotMap.rightBackMotor, m_robotMap.driveTrain, m_robotMap.gyroDrive);
|
||||
|
||||
private final LED m_robotLED = new LED(m_robotMap.LEDController);
|
||||
|
||||
private final FalconTester m_falconTester = new FalconTester(m_robotMap.falconTestMotor);
|
||||
|
||||
/* Controllers */
|
||||
private final XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID);
|
||||
private final XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID);
|
||||
@@ -48,9 +48,9 @@ public class RobotContainer {
|
||||
|
||||
/* Default Commands */
|
||||
// drives the robot with a two-axis input from the driver controller
|
||||
m_robotDrive.setDefaultCommand(
|
||||
new RunCommand(() -> m_robotDrive.driveWithInput(getDriverController().getLeftYAxis(),
|
||||
getDriverController().getRightXAxis()), m_robotDrive));
|
||||
m_falconTester.setDefaultCommand(
|
||||
new RunCommand(() -> m_falconTester.setMotorSpeed(0.1d * getDriverController().getLeftYAxis()),
|
||||
m_falconTester));
|
||||
// continually sends updates to the Blinkin LED controller to keep the lights on
|
||||
m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED));
|
||||
}
|
||||
@@ -64,8 +64,8 @@ public class RobotContainer {
|
||||
private void configureButtonBindings() {
|
||||
/* Driver Buttons */
|
||||
// test command to spin the robot while pressing A on the driver controller
|
||||
new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
|
||||
.whileHeld(() -> m_robotDrive.driveWithInput(0, 1));
|
||||
// new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
|
||||
// .whileHeld(() -> m_robotDrive.driveWithInput(0, 1));
|
||||
|
||||
/* Operator Buttons */
|
||||
// activates "Lit Mode"
|
||||
|
||||
Reference in New Issue
Block a user