mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fix trivial errorprone warnings (NFC) (#6135)
This commit is contained in:
@@ -80,7 +80,7 @@ public final class StateSpaceUtil {
|
||||
if (tolerances.get(i, 0) == Double.POSITIVE_INFINITY) {
|
||||
result.set(i, i, 0.0);
|
||||
} else {
|
||||
result.set(i, i, 1.0 / (Math.pow(tolerances.get(i, 0), 2)));
|
||||
result.set(i, i, 1.0 / Math.pow(tolerances.get(i, 0), 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ public class ControlAffinePlantInversionFeedforward<States extends Num, Inputs e
|
||||
* @return The calculated feedforward.
|
||||
*/
|
||||
public Matrix<Inputs, N1> calculate(Matrix<States, N1> r, Matrix<States, N1> nextR) {
|
||||
var rDot = (nextR.minus(r)).div(m_dt);
|
||||
var rDot = nextR.minus(r).div(m_dt);
|
||||
|
||||
// ṙ = f(r) + Bu
|
||||
// Bu = ṙ − f(r)
|
||||
|
||||
@@ -114,7 +114,7 @@ public class SteadyStateKalmanFilter<States extends Num, Inputs extends Num, Out
|
||||
// K = (Sᵀ.solve(CPᵀ))ᵀ
|
||||
m_K =
|
||||
new Matrix<>(
|
||||
S.transpose().getStorage().solve((C.times(P.transpose())).getStorage()).transpose());
|
||||
S.transpose().getStorage().solve(C.times(P.transpose()).getStorage()).transpose());
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TravelingSalesman {
|
||||
sum +=
|
||||
m_cost.applyAsDouble(
|
||||
poses[(int) state.get(i, 0)],
|
||||
poses[(int) (state.get((i + 1) % poses.length, 0))]);
|
||||
poses[(int) state.get((i + 1) % poses.length, 0)]);
|
||||
}
|
||||
return sum;
|
||||
});
|
||||
|
||||
@@ -180,7 +180,7 @@ public class LinearSystem<States extends Num, Inputs extends Num, Outputs extend
|
||||
Matrix<States, N1> x, Matrix<Inputs, N1> clampedU, double dtSeconds) {
|
||||
var discABpair = Discretization.discretizeAB(m_A, m_B, dtSeconds);
|
||||
|
||||
return (discABpair.getFirst().times(x)).plus(discABpair.getSecond().times(clampedU));
|
||||
return discABpair.getFirst().times(x).plus(discABpair.getSecond().times(clampedU));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -292,7 +292,7 @@ public class LinearSystemLoop<States extends Num, Inputs extends Num, Outputs ex
|
||||
* @return The error at that index.
|
||||
*/
|
||||
public double getError(int index) {
|
||||
return (getController().getR().minus(m_observer.getXhat())).get(index, 0);
|
||||
return getController().getR().minus(m_observer.getXhat()).get(index, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user