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);
|
||||
|
||||
@@ -236,7 +236,7 @@ public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Output
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_xHat = new Matrix<>(m_states, Nat.N1());
|
||||
m_P = m_initP;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ public class KalmanFilter<States extends Num, Inputs extends Num, Outputs extend
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_xHat = new Matrix<>(m_states, Nat.N1());
|
||||
m_P = m_initP;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class PoseEstimator<T extends WheelPositions<T>> {
|
||||
* numbers to trust global measurements from vision less. This matrix is in the form [x, y,
|
||||
* theta]ᵀ, with units in meters and radians.
|
||||
*/
|
||||
public void setVisionMeasurementStdDevs(Matrix<N3, N1> visionMeasurementStdDevs) {
|
||||
public final void setVisionMeasurementStdDevs(Matrix<N3, N1> visionMeasurementStdDevs) {
|
||||
var r = new double[3];
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
r[i] = visionMeasurementStdDevs.get(i, 0) * visionMeasurementStdDevs.get(i, 0);
|
||||
|
||||
@@ -115,7 +115,7 @@ public class SteadyStateKalmanFilter<States extends Num, Inputs extends Num, Out
|
||||
reset();
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_xHat = new Matrix<>(m_states, Nat.N1());
|
||||
}
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ public class UnscentedKalmanFilter<States extends Num, Inputs extends Num, Outpu
|
||||
|
||||
/** Resets the observer. */
|
||||
@Override
|
||||
public void reset() {
|
||||
public final void reset() {
|
||||
m_xHat = new Matrix<>(m_states, Nat.N1());
|
||||
m_S = new Matrix<>(m_states, m_states);
|
||||
m_sigmasF = new Matrix<>(new SimpleMatrix(m_states.getNum(), 2 * m_states.getNum() + 1));
|
||||
|
||||
@@ -265,7 +265,7 @@ public class LinearSystemLoop<States extends Num, Inputs extends Num, Outputs ex
|
||||
*
|
||||
* @param initialState The initial state.
|
||||
*/
|
||||
public void reset(Matrix<States, N1> initialState) {
|
||||
public final void reset(Matrix<States, N1> initialState) {
|
||||
m_nextR.fill(0.0);
|
||||
m_controller.reset();
|
||||
m_feedforward.reset(initialState);
|
||||
|
||||
Reference in New Issue
Block a user