Fix trivial errorprone warnings (NFC) (#6135)

This commit is contained in:
David Vo
2024-01-20 15:46:38 +11:00
committed by GitHub
parent d198605562
commit a274e297cd
22 changed files with 33 additions and 36 deletions

View File

@@ -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));
}
}

View File

@@ -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)

View File

@@ -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();
}

View File

@@ -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;
});

View File

@@ -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));
}
/**

View File

@@ -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);
}
/**