edited aimtocenter

This commit is contained in:
Abhishrek05
2022-02-19 13:32:39 -07:00
parent b5215b7a09
commit 64481cb1cc
2 changed files with 3 additions and 7 deletions
@@ -31,17 +31,13 @@ public class AimToCenter extends CommandBase {
// Called when the command is initially scheduled.
@Override
public void initialize() {
m_targetAngle = m_turret.getBoomBoomAngleDegrees() + m_drive.gyro.getAngle() + Math.atan(y/x);
}
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
aimTurret(m_targetAngle);
}
public void aimTurret(double targetAngle) { //Split into configure and run
m_turret.runshooterRotatePID(targetAngle);
m_targetAngle = m_turret.getBoomBoomAngleDegrees() + m_drive.gyro.getAngle() + Math.atan(y/x);
m_turret.runshooterRotatePID(m_targetAngle);
}
// Called once the command ends or is interrupted.