mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fix JDK 21 warnings (#6028)
This commit is contained in:
@@ -37,6 +37,7 @@ public class BangBangController implements Sendable {
|
||||
*
|
||||
* @param tolerance Tolerance for {@link #atSetpoint() atSetpoint}.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public BangBangController(double tolerance) {
|
||||
instances++;
|
||||
|
||||
@@ -89,7 +90,7 @@ public class BangBangController implements Sendable {
|
||||
*
|
||||
* @param tolerance Position error which is tolerable.
|
||||
*/
|
||||
public void setTolerance(double tolerance) {
|
||||
public final void setTolerance(double tolerance) {
|
||||
m_tolerance = tolerance;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,13 +144,13 @@ public class ControlAffinePlantInversionFeedforward<States extends Num, Inputs e
|
||||
*
|
||||
* @param initialState The initial state vector.
|
||||
*/
|
||||
public void reset(Matrix<States, N1> initialState) {
|
||||
public final void reset(Matrix<States, N1> initialState) {
|
||||
m_r = initialState;
|
||||
m_uff.fill(0.0);
|
||||
}
|
||||
|
||||
/** Resets the feedforward with a zero initial state vector. */
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_r.fill(0.0);
|
||||
m_uff.fill(0.0);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ImplicitModelFollower<States extends Num, Inputs extends Num, Outpu
|
||||
}
|
||||
|
||||
/** Resets the controller. */
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_u.fill(0.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -105,13 +105,13 @@ public class LinearPlantInversionFeedforward<
|
||||
*
|
||||
* @param initialState The initial state vector.
|
||||
*/
|
||||
public void reset(Matrix<States, N1> initialState) {
|
||||
public final void reset(Matrix<States, N1> initialState) {
|
||||
m_r = initialState;
|
||||
m_uff.fill(0.0);
|
||||
}
|
||||
|
||||
/** Resets the feedforward with a zero initial state vector. */
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_r.fill(0.0);
|
||||
m_uff.fill(0.0);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class LinearQuadraticRegulator<States extends Num, Inputs extends Num, Ou
|
||||
}
|
||||
|
||||
/** Resets the controller. */
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_r.fill(0.0);
|
||||
m_u.fill(0.0);
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ public class PIDController implements Sendable, AutoCloseable {
|
||||
* @param kd The derivative coefficient.
|
||||
* @param period The period between controller updates in seconds. Must be non-zero and positive.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public PIDController(double kp, double ki, double kd, double period) {
|
||||
m_kp = kp;
|
||||
m_ki = ki;
|
||||
|
||||
@@ -50,6 +50,7 @@ public class ProfiledPIDController implements Sendable {
|
||||
* @param constraints Velocity and acceleration constraints for goal.
|
||||
* @param period The period between controller updates in seconds. The default is 0.02 seconds.
|
||||
*/
|
||||
@SuppressWarnings("this-escape")
|
||||
public ProfiledPIDController(
|
||||
double Kp, double Ki, double Kd, TrapezoidProfile.Constraints constraints, double period) {
|
||||
m_controller = new PIDController(Kp, Ki, Kd, period);
|
||||
|
||||
Reference in New Issue
Block a user