Merge branch 'testRoboReveal' of https://github.com/Team4388/2022NoWayHome into testRoboReveal

This commit is contained in:
Ryan Manley
2022-03-12 11:37:33 -07:00
3 changed files with 34 additions and 38 deletions
+4 -2
View File
@@ -1,3 +1,5 @@
Distance (in) ,Hood Ext. (u) ,Drum Velocity (u/ds)
0 ,16 ,0
999 ,28.8 ,1200
96 ,-25.00 ,0.425
144 ,-47.57 ,0.475
192 ,-55.55 ,0.500
240 ,-96.00 ,0.525
1 Distance (in) Hood Ext. (u) Drum Velocity (u/ds)
2 0 96 16 -25.00 0 0.425
3 999 144 28.8 -47.57 1200 0.475
4 192 -55.55 0.500
5 240 -96.00 0.525
+25 -33
View File
@@ -106,8 +106,9 @@ public class RobotContainer {
private final VisionOdometry m_robotVisionOdometry = new VisionOdometry(m_robotSwerveDrive, m_robotTurret);
private final WPI_TalonFX testElbowMotor = new WPI_TalonFX(30);
private final WPI_TalonFX testSoulderMotor = new WPI_TalonFX(31);
private final WPI_TalonFX testShoulderMotor = new WPI_TalonFX(31);
public final Climber m_robotClimber = new Climber(testElbowMotor);
/* Controllers */
private final XboxController m_driverXbox = new DeadbandedXboxController(OIConstants.XBOX_DRIVER_ID);
private final XboxController m_operatorXbox = new DeadbandedXboxController(OIConstants.XBOX_OPERATOR_ID);
@@ -132,7 +133,7 @@ public class RobotContainer {
*/
public RobotContainer() {
configureButtonBindings();
testSoulderMotor.setNeutralMode(NeutralMode.Brake);
testShoulderMotor.setNeutralMode(NeutralMode.Brake);
/* Default Commands */
// Swerve Drive with Input
@@ -172,13 +173,10 @@ public class RobotContainer {
// new AimToCenter(m_robotTurret, m_robotSwerveDrive, m_robotVisionOdometry));
// continually sends updates to the Blinkin LED controller to keep the lights on
/*
* m_robotLED
* .setDefaultCommand(new RunCommand(m_robotLED::updateLED,
* m_robotLED).withName("LED update defaultCommand"));
* autoInit();
* recordInit();
*/
// m_robotLED.setDefaultCommand(new RunCommand(m_robotLED::updateLED, m_robotLED).withName("LED update defaultCommand"));
// autoInit();
// recordInit();
}
/**
@@ -229,33 +227,27 @@ public class RobotContainer {
new JoystickButton(getOperatorController(), XboxController.Button.kY.value)
.whenPressed(() -> m_robotIntake.runExtender(false));*/
new JoystickButton(getOperatorController(), XboxController.Button.kA.value) //8ft
// .whenPressed(new InstantCommand(() -> m_robotTurret.m_boomBoomRotateEncoder.setPosition(0)));
// .whenPressed(() -> m_robotBoomBoom.increaseSpeed(0.025));
.whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.425)))
.whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-25)))
.whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kA.value) //8ft
// .whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.425)))
// .whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-25)))
// .whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kB.value) //12ft
.whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.475)))
.whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-47.57)))
.whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
// .whenPressed(new InstantCommand(() -> m_robotHood.m_angleEncoder.setPosition(0)));
// .whenPressed(() -> m_robotBoomBoom.increaseSpeed(-0.025));
// new JoystickButton(getOperatorController(), XboxController.Button.kB.value) //12ft
// .whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.475)))
// .whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-47.57)))
// .whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kY.value) //16ft
.whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.5)))
.whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-55.55)))
.whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kY.value) //16ft
// .whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.5)))
// .whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-55.55)))
// .whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kX.value) //20ft
.whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.525)))
.whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-96)))
// .whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
// .whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.45)))
.whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
// new JoystickButton(getOperatorController(), XboxController.Button.kX.value) //20ft
// .whileHeld(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.525)))
// .whileHeld(new RunCommand(() -> m_robotHood.runAngleAdjustPID(-96)))
// .whenReleased(new RunCommand(() -> m_robotBoomBoom.runDrumShooter(0.0)));
new JoystickButton(getOperatorController(), XboxController.Button.kLeftBumper.value)
.whileHeld(new RunCommand(() -> m_robotStorage.runStorage(-0.9), m_robotStorage))
@@ -278,8 +270,8 @@ public class RobotContainer {
.whenPressed(new Shoot(m_robotSwerveDrive, m_robotBoomBoom, m_robotTurret, m_robotHood));*/
//B > Shoot with Lime
// new JoystickButton(getOperatorController(), XboxController.Button.kB.value)
// .whenPressed(new TrackTarget(m_robotTurret, m_robotBoomBoom, m_robotHood, m_robotSwerveDrive, m_robotVisionOdometry));
new JoystickButton(getOperatorController(), XboxController.Button.kB.value)
.whenPressed(new TrackTarget(m_robotTurret, m_robotBoomBoom, m_robotHood, m_robotSwerveDrive, m_robotVisionOdometry));
}
/**
@@ -46,7 +46,8 @@ public class TrackTarget extends CommandBase {
m_boomBoom = boomBoom;
m_hood = hood;
m_visionOdometry = visionOdometry;
addRequirements(m_turret, m_drive, m_visionOdometry);
addRequirements(m_turret, m_boomBoom, m_hood, m_drive, m_visionOdometry);
}
// Called when the command is initially scheduled.
@@ -78,8 +79,9 @@ public class TrackTarget extends CommandBase {
}
vel = m_boomBoom.getVelocity(distance);
hood = m_boomBoom.getHood(distance);
m_boomBoom.runDrumShooterVelocityPID(vel);
m_hood.runAngleAdjustPID(hood);
// m_boomBoom.runDrumShooter(vel);
// m_boomBoom.runDrumShooterVelocityPID(vel);
// m_hood.runAngleAdjustPID(hood);
//m_turret.runshooterRotatePID(m_targetAngle);
}