Merge pull request #64 from Team4388/bouncePath

Bounce path
This commit is contained in:
aarav18
2021-04-22 16:58:08 -06:00
committed by GitHub
2 changed files with 7 additions and 2 deletions
@@ -141,6 +141,7 @@ public class RobotContainer {
TenBallAutoMiddle m_tenBallAutoMiddle;
Slalom m_slalom;
Barrel m_barrel;
@@ -198,6 +199,7 @@ public class RobotContainer {
// runs the storage not
m_robotStorage.setDefaultCommand(new ManageStorage(m_robotStorage));
m_robotLime.setDefaultCommand(new RunCommand(() -> m_robotLime.limeOff(), m_robotLime));
}
/**
@@ -208,13 +210,13 @@ public class RobotContainer {
*/
private void configureButtonBindings() {
/* Test Buttons */
// A driver test button
new JoystickButton(getDriverJoystick(), XboxController.A_BUTTON)
.whileHeld(new ShooterTrenchPosition(m_robotShooter, m_robotShooterHood, m_robotShooterAim))
.whenReleased(new InterruptSubystem(m_robotShooter))
.whenReleased(new InterruptSubystem(m_robotShooterHood));
// B driver test button
new JoystickButton(getDriverJoystick(), XboxController.B_BUTTON)
.whileHeld(new RunCommand(() -> m_robotDrive.runDriveVelocityPID(2000, 45), m_robotDrive));
@@ -434,6 +436,7 @@ public class RobotContainer {
};
m_sequentialTest = new SequentialTest(this, buildPaths(sequentialTestPaths));
}
/**
@@ -461,6 +464,7 @@ public class RobotContainer {
//return m_slalom.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
//return m_barrelStart.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
//return m_bounce.andThen(()-> m_robotDrive.tankDriveVelocity(0, 0));
} catch (Exception e) {
System.err.println("ERROR");
}
@@ -345,7 +345,8 @@ public class Drive extends SubsystemBase {
public void updateOdometry(boolean reversed){
if (reversed){
m_odometry.update(Rotation2d.fromDegrees( -getHeading()-180),
m_odometry.update(Rotation2d.fromDegrees( -getGyroYaw()-180),
-inchesToMeters(getDistanceInches(m_rightFrontMotor)),
inchesToMeters(getDistanceInches(m_leftFrontMotor)));
}