offsets (INCOMPLETE DO NOT TOUCH)

This commit is contained in:
aarav18
2023-01-21 15:16:22 -07:00
parent 3697360963
commit 56ad89a974
6 changed files with 149 additions and 55 deletions
@@ -53,18 +53,26 @@ public class RobotContainer {
// continually sends updates to the Blinkin LED controller to keep the lights on
// m_robotLED.setDefaultCommand(new RunCommand(() -> m_robotLED.updateLED(), m_robotLED));
m_robotSwerveDrive.setDefaultCommand(
new RunCommand(() -> m_robotSwerveDrive.driveWithInput(-0.3*getDriverController().getLeftXAxis(),
0.3*getDriverController().getLeftYAxis(),
-0.3*getDriverController().getRightXAxis(), false), m_robotSwerveDrive)
);
// m_robotSwerveDrive.setDefaultCommand(
// new RunCommand(() -> m_robotSwerveDrive.driveWithInput(-0.3*getDriverController().getLeftXAxis(),
// 0.3*getDriverController().getLeftYAxis(),
// -0.3*getDriverController().getRightXAxis(), false), m_robotSwerveDrive)
// );
// m_robotSwerveDrive.setDefaultCommand(
// new RunCommand(() -> m_robotSwerveDrive.runAllSteerMotors(0.2*getDriverController().getLeftYAxis()), m_robotSwerveDrive)
// );
// m_robotSwerveDrive.setDefaultCommand(
// new RunCommand(() -> m_robotSwerveDrive.leftBack.angleMotor.set(0.2*getDriverController().getRightYAxis()), m_robotSwerveDrive)
// new RunCommand(() -> m_robotSwerveDrive.driveWithInput(0,
// -0.1,
// 0, false), m_robotSwerveDrive)
// );
m_robotSwerveDrive.setDefaultCommand(
new RunCommand(() -> m_robotSwerveDrive.driveWithInput(
-0.3 * getDriverController().getLeftXAxis(),
0.3 * getDriverController().getLeftYAxis(),
0.3 * getDriverController().getRightXAxis(),
0.3 * getDriverController().getRightYAxis(),
true),
m_robotSwerveDrive).withName("Swerve driveWithInput defaultCommand"));
}
/**
@@ -85,6 +93,12 @@ public class RobotContainer {
// .whileTrue(new RunCommand(() -> m_robotLED.setPattern(LEDPatterns.LAVA_RAINBOW), m_robotLED))
// .whileFalse(new RunCommand(() -> m_robotLED.setPattern(LEDConstants.DEFAULT_PATTERN), m_robotLED));
new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
.whileTrue(new RunCommand(() -> m_robotSwerveDrive.rotateCANCodersToAngle(0), m_robotSwerveDrive));
new JoystickButton(getDriverJoystick(), XboxController.B_BUTTON)
.onTrue(new InstantCommand(() -> m_robotSwerveDrive.resetCANCoders(0), m_robotSwerveDrive));
//New interupt button
new JoystickButton(getOperatorJoystick(), XboxController.X_BUTTON)
.onTrue(new InstantCommand());