mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[glass] Add Profiled PID controller support & IZone Support (#5959)
This commit is contained in:
@@ -409,7 +409,16 @@ public class PIDController implements Sendable, AutoCloseable {
|
||||
builder.addDoubleProperty("p", this::getP, this::setP);
|
||||
builder.addDoubleProperty("i", this::getI, this::setI);
|
||||
builder.addDoubleProperty("d", this::getD, this::setD);
|
||||
builder.addDoubleProperty("izone", this::getIZone, this::setIZone);
|
||||
builder.addDoubleProperty(
|
||||
"izone",
|
||||
this::getIZone,
|
||||
(double toSet) -> {
|
||||
try {
|
||||
setIZone(toSet);
|
||||
} catch (IllegalArgumentException e) {
|
||||
MathSharedStore.reportError("IZone must be a non-negative number!", e.getStackTrace());
|
||||
}
|
||||
});
|
||||
builder.addDoubleProperty("setpoint", this::getSetpoint, this::setSetpoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,16 @@ public class ProfiledPIDController implements Sendable {
|
||||
builder.addDoubleProperty("p", this::getP, this::setP);
|
||||
builder.addDoubleProperty("i", this::getI, this::setI);
|
||||
builder.addDoubleProperty("d", this::getD, this::setD);
|
||||
builder.addDoubleProperty("izone", this::getIZone, this::setIZone);
|
||||
builder.addDoubleProperty(
|
||||
"izone",
|
||||
this::getIZone,
|
||||
(double toSet) -> {
|
||||
try {
|
||||
setIZone(toSet);
|
||||
} catch (IllegalArgumentException e) {
|
||||
MathSharedStore.reportError("IZone must be a non-negative number!", e.getStackTrace());
|
||||
}
|
||||
});
|
||||
builder.addDoubleProperty("goal", () -> getGoal().position, this::setGoal);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user