mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Upgrade maven deps to latest versions and fix new linter errors (#3772)
This also makes the Gradle build work with JDK 17. The extra JVM args in gradle.properties works around a bug with spotless and JDK 17: https://github.com/diffplug/spotless/issues/834 PMD.CloseResource was ignored because it's almost always a false positive, and there are many of them.
This commit is contained in:
@@ -104,10 +104,11 @@ public class LinearQuadraticRegulator<States extends Num, Inputs extends Num, Ou
|
||||
|
||||
if (!StateSpaceUtil.isStabilizable(discA, discB)) {
|
||||
var builder = new StringBuilder("The system passed to the LQR is uncontrollable!\n\nA =\n");
|
||||
builder.append(discA.getStorage().toString());
|
||||
builder.append("\nB =\n");
|
||||
builder.append(discB.getStorage().toString());
|
||||
builder.append("\n");
|
||||
builder
|
||||
.append(discA.getStorage().toString())
|
||||
.append("\nB =\n")
|
||||
.append(discB.getStorage().toString())
|
||||
.append('\n');
|
||||
|
||||
var msg = builder.toString();
|
||||
MathSharedStore.reportError(msg, Thread.currentThread().getStackTrace());
|
||||
|
||||
@@ -79,10 +79,11 @@ public class KalmanFilter<States extends Num, Inputs extends Num, Outputs extend
|
||||
if (!StateSpaceUtil.isDetectable(discA, C)) {
|
||||
var builder =
|
||||
new StringBuilder("The system passed to the Kalman filter is unobservable!\n\nA =\n");
|
||||
builder.append(discA.getStorage().toString());
|
||||
builder.append("\nC =\n");
|
||||
builder.append(C.getStorage().toString());
|
||||
builder.append("\n");
|
||||
builder
|
||||
.append(discA.getStorage().toString())
|
||||
.append("\nC =\n")
|
||||
.append(C.getStorage().toString())
|
||||
.append('\n');
|
||||
|
||||
var msg = builder.toString();
|
||||
MathSharedStore.reportError(msg, Thread.currentThread().getStackTrace());
|
||||
|
||||
@@ -209,8 +209,6 @@ public class TrapezoidProfile {
|
||||
|
||||
endAccel = Math.max(endAccel, 0);
|
||||
endFullSpeed = Math.max(endFullSpeed, 0);
|
||||
double endDeccel = m_endDeccel - endAccel - endFullSpeed;
|
||||
endDeccel = Math.max(endDeccel, 0);
|
||||
|
||||
final double acceleration = m_constraints.maxAcceleration;
|
||||
final double decceleration = -m_constraints.maxAcceleration;
|
||||
@@ -229,11 +227,8 @@ public class TrapezoidProfile {
|
||||
deccelVelocity = velocity;
|
||||
}
|
||||
|
||||
double deccelDist = deccelVelocity * endDeccel + 0.5 * decceleration * endDeccel * endDeccel;
|
||||
|
||||
deccelDist = Math.max(deccelDist, 0);
|
||||
|
||||
double fullSpeedDist = m_constraints.maxVelocity * endFullSpeed;
|
||||
double deccelDist;
|
||||
|
||||
if (accelDist > distToTarget) {
|
||||
accelDist = distToTarget;
|
||||
|
||||
Reference in New Issue
Block a user