mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
goto 0 methods for hood + turret
This commit is contained in:
@@ -322,7 +322,7 @@ public class RobotContainer {
|
||||
.whenPressed(new Shoot(m_robotSwerveDrive, m_robotBoomBoom, m_robotTurret, m_robotHood));*/
|
||||
|
||||
new JoystickButton(getOperatorController(), XboxController.Button.kA.value)
|
||||
.whileHeld(new RunCommand(() -> m_robotTurret.runshooterRotatePID(-44 * ShooterConstants.TURRET_DEGREES_PER_ROT), m_robotTurret));
|
||||
.whileHeld(new RunCommand(() -> m_robotTurret.runShooterRotatePID(-44 * ShooterConstants.TURRET_DEGREES_PER_ROT), m_robotTurret));
|
||||
|
||||
//B > Shoot with Lime
|
||||
new JoystickButton(getOperatorController(), XboxController.Button.kB.value)
|
||||
|
||||
@@ -43,7 +43,7 @@ public class AimToCenter extends CommandBase {
|
||||
@Override
|
||||
public void execute() {
|
||||
m_targetAngle = angleToCenter(x, y, m_drive.getRegGyro().getDegrees());
|
||||
m_turret.runshooterRotatePID(m_targetAngle);
|
||||
m_turret.runShooterRotatePID(m_targetAngle);
|
||||
|
||||
// Check if limelight is within range (comment out to disable vision odo)
|
||||
if (Math.abs(m_turret.getBoomBoomAngleDegrees() - m_targetAngle) < VisionConstants.RANGE){
|
||||
|
||||
@@ -90,7 +90,14 @@ public class Hood extends SubsystemBase {
|
||||
m_angleAdjusterMotor.set(input);
|
||||
}
|
||||
|
||||
public void resetGyroAngleAdj(){
|
||||
/**
|
||||
* Run a PID to go to the zero position.
|
||||
*/
|
||||
public void gotoZero() {
|
||||
runAngleAdjustPID(0);
|
||||
}
|
||||
|
||||
public void resetGyroAngleAdj() {
|
||||
m_angleEncoder.setPosition(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public class Turret extends SubsystemBase {
|
||||
m_boomBoomRotateMotor.set(input * ShooterConstants.TURRET_SPEED_MULTIPLIER);
|
||||
}
|
||||
|
||||
public void runshooterRotatePID(double targetAngle) {
|
||||
public void runShooterRotatePID(double targetAngle) {
|
||||
targetAngle = targetAngle / ShooterConstants.TURRET_DEGREES_PER_ROT;
|
||||
m_boomBoomRotatePIDController.setReference(targetAngle, ControlType.kPosition);
|
||||
}
|
||||
@@ -102,6 +102,13 @@ public class Turret extends SubsystemBase {
|
||||
m_boomBoomRotateEncoder.setPosition(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Run a PID to go to the zero position.
|
||||
*/
|
||||
public void gotoZero() {
|
||||
runShooterRotatePID(0);
|
||||
}
|
||||
|
||||
public double getboomBoomRotatePosition() {
|
||||
return m_boomBoomRotateEncoder.getPosition();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user