mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
sdfg
This commit is contained in:
@@ -37,7 +37,7 @@ public final class Constants {
|
|||||||
public static final double LOOP_TIME = 0.02;
|
public static final double LOOP_TIME = 0.02;
|
||||||
|
|
||||||
public static final class SwerveDriveConstants {
|
public static final class SwerveDriveConstants {
|
||||||
public static final double ROTATION_SPEED = 2.0;
|
public static final double ROTATION_SPEED = 2.3;
|
||||||
public static final double WIDTH = 23.75;
|
public static final double WIDTH = 23.75;
|
||||||
public static final double HEIGHT = 23.75;
|
public static final double HEIGHT = 23.75;
|
||||||
public static final double JOYSTICK_TO_METERS_PER_SECOND_FAST = 11;
|
public static final double JOYSTICK_TO_METERS_PER_SECOND_FAST = 11;
|
||||||
|
|||||||
@@ -226,12 +226,22 @@ public class RobotContainer {
|
|||||||
configureButtonBindings();
|
configureButtonBindings();
|
||||||
/* Default Commands */
|
/* Default Commands */
|
||||||
// Swerve Drive with Input
|
// Swerve Drive with Input
|
||||||
m_robotSwerveDrive.setDefaultCommand(
|
m_robotSwerveDrive.setDefaultCommand(
|
||||||
new RunCommand(() -> m_robotSwerveDrive.driveWithInput( getDriverController().getLeftX(),
|
new RunCommand(() -> {
|
||||||
getDriverController().getLeftY(),
|
if (currentDriveMode.equals(DriveMode.ON)) {
|
||||||
getDriverController().getRightX(),
|
m_robotSwerveDrive.driveWithInput( getDriverController().getLeftX(),
|
||||||
getDriverController().getRightY(),
|
getDriverController().getLeftY(),
|
||||||
true), m_robotSwerveDrive).withName("Swerve driveWithInput defaultCommand"));
|
getDriverController().getRightX(),
|
||||||
|
getDriverController().getRightY(),
|
||||||
|
true); }
|
||||||
|
if (currentDriveMode.equals(DriveMode.OFF)) {
|
||||||
|
m_robotSwerveDrive.driveWithInput( 0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
false);
|
||||||
|
}}
|
||||||
|
, m_robotSwerveDrive).withName("Swerve driveWithInput defaultCommand"));
|
||||||
|
|
||||||
// Intake with Triggers
|
// Intake with Triggers
|
||||||
m_robotIntake.setDefaultCommand(
|
m_robotIntake.setDefaultCommand(
|
||||||
@@ -256,7 +266,7 @@ public class RobotContainer {
|
|||||||
// Hood Manual
|
// Hood Manual
|
||||||
m_robotHood.setDefaultCommand(
|
m_robotHood.setDefaultCommand(
|
||||||
new RunCommand(() -> {
|
new RunCommand(() -> {
|
||||||
if (RobotContainer.currentControlMode.equals(ControlMode.SHOOTER)) { m_robotHood.runHood(getOperatorController().getRightY()); }
|
if (RobotContainer.currentControlMode.equals(ControlMode.SHOOTER)) { m_robotHood.runHood(getOperatorController().getLeftY()); }
|
||||||
if (RobotContainer.currentControlMode.equals(ControlMode.CLIMBER)) { m_robotHood.runHood(0); }
|
if (RobotContainer.currentControlMode.equals(ControlMode.CLIMBER)) { m_robotHood.runHood(0); }
|
||||||
}, m_robotHood));
|
}, m_robotHood));
|
||||||
|
|
||||||
@@ -302,6 +312,8 @@ public class RobotContainer {
|
|||||||
.whenPressed(() -> m_robotSwerveDrive.highSpeed(true));
|
.whenPressed(() -> m_robotSwerveDrive.highSpeed(true));
|
||||||
|
|
||||||
|
|
||||||
|
new JoystickButton(getDriverController(), XboxController.Button.kA.value)
|
||||||
|
.whenPressed(new InstantCommand());
|
||||||
|
|
||||||
//! Operator Buttons
|
//! Operator Buttons
|
||||||
|
|
||||||
@@ -384,13 +396,13 @@ public class RobotContainer {
|
|||||||
new JoystickButton(getButtonBox(), ButtonBox.Button.kMiddleSwitch.value)
|
new JoystickButton(getButtonBox(), ButtonBox.Button.kMiddleSwitch.value)
|
||||||
.whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.CLIMBER))
|
.whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.CLIMBER))
|
||||||
.whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER));
|
.whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER));
|
||||||
new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value)
|
// new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value)
|
||||||
.whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.CLIMBER))
|
// .whenPressed(new InstantCommand(() -> currentControlMode = ControlMode.))
|
||||||
.whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER));
|
// .whenReleased(new InstantCommand(() -> currentControlMode = ControlMode.SHOOTER));
|
||||||
|
|
||||||
// new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value)
|
new JoystickButton(getButtonBox(), ButtonBox.Button.kRightSwitch.value)
|
||||||
// .whileHeld(new InstantCommand(() -> currentDriveMode = DriveMode.OFF))
|
.whileHeld(new InstantCommand(() -> currentDriveMode = DriveMode.OFF))
|
||||||
// .whenReleased(new InstantCommand(() -> currentDriveMode = DriveMode.ON));
|
.whenReleased(new InstantCommand(() -> currentDriveMode = DriveMode.ON));
|
||||||
|
|
||||||
// Left Button > Extender In
|
// Left Button > Extender In
|
||||||
new JoystickButton(getButtonBox(), ButtonBox.Button.kLeftButton.value)
|
new JoystickButton(getButtonBox(), ButtonBox.Button.kLeftButton.value)
|
||||||
@@ -489,7 +501,7 @@ public class RobotContainer {
|
|||||||
|
|
||||||
// ! DRIVE BACKWARDS AND SHOOT (HOPEFULLY)
|
// ! DRIVE BACKWARDS AND SHOOT (HOPEFULLY)
|
||||||
return new SequentialCommandGroup( new InstantCommand(() -> m_robotSwerveDrive.resetGyro(), m_robotSwerveDrive), // * reset gyro before moving
|
return new SequentialCommandGroup( new InstantCommand(() -> m_robotSwerveDrive.resetGyro(), m_robotSwerveDrive), // * reset gyro before moving
|
||||||
new DriveWithInputForTime(m_robotSwerveDrive, new double[] {1.0, 0.0, 0.0, 0.0}, (4.0 * 12) / distancePerSecond),//0.269), // * go backwards three feet
|
new DriveWithInputForTime(m_robotSwerveDrive, new double[] {1.0, 0.0, 0.0, 0.0}, (5.0 * 12) / distancePerSecond),//0.269), // * go backwards three feet
|
||||||
new InstantCommand(() -> m_robotSwerveDrive.stopModules(), m_robotSwerveDrive), // * brake
|
new InstantCommand(() -> m_robotSwerveDrive.stopModules(), m_robotSwerveDrive), // * brake
|
||||||
|
|
||||||
weirdAutoShootingGroup, // * shoot
|
weirdAutoShootingGroup, // * shoot
|
||||||
|
|||||||
Reference in New Issue
Block a user