Skip to content

Commit

Permalink
Add missing methods to rotation PID controler
Browse files Browse the repository at this point in the history
  • Loading branch information
viggy96 committed Sep 18, 2024
1 parent 7d66286 commit 629f3c9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/main/java/org/lasarobotics/drive/RotatePIDController.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public RotatePIDController(PolynomialSplineFunction rotateInputCurve, PIDConstan
}

/**
* Returns next output of RotatePIDController
* Returns next output of rotation PID controller
* @param currentAngle current yaw angle of robot
* @param rotateRate current yaw rotate rate of robot
* @param rotateRequest rotate request [-1.0, +1.0]
Expand Down Expand Up @@ -89,6 +89,21 @@ public Measure<Velocity<Angle>> calculate(Measure<Angle> currentAngle, Measure<V
return Units.DegreesPerSecond.of(m_pidController.calculate(currentAngle.in(Units.Degrees)));
}

/**
* Set setpoint of rotation PID controller
* @param angle
*/
public void setSetpoint(Measure<Angle> angle) {
m_pidController.setSetpoint(angle.in(Units.Degrees));
}

/**
* Reset rotation PID controller
*/
public void reset() {
m_pidController.reset();
}

/**
* Get if robot is rotating
* @return True if rotating
Expand Down

0 comments on commit 629f3c9

Please sign in to comment.