Exploit databaseDownload repository ZIP
GH-5fbbd02ef8781becfaa9bbb24c21a7fd
25wangj/ftccenterstage16460
Sources for CVE-2019-11358
1,181 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files11
25wangj/ftccenterstage16460Revision 4567bd0168c4
- ↑..Parent directory
- AsymConstraints.java
- AsymProfile.java
- AsyncExtendedKalmanFilter.java
- DelayProfile.java
- KalmanEstimate.java
- KalmanState.java
- MotionProfile.java
- PidCoefficients.java
- PidfController.java
- SymConstraints.java
- SymProfile.java
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/control/PidfController.java
Java · 1,766 bytespackage org.firstinspires.ftc.teamcode.control;
import java.util.function.ToDoubleFunction;
public class PidfController {
private PidCoefficients coeffs;
ToDoubleFunction<double[]> kf;
private double setPoint = 0;
private double e = 0;
private double i = 0;
private double d = 0;
private double f = 0;
private double lastTime = Double.NaN;
private double lastE = 0;
public PidfController(PidCoefficients coeffs) {
this(coeffs, x -> 0d);
}
public PidfController(PidCoefficients coeffs, ToDoubleFunction<double[]> kf) {
this.coeffs = coeffs;
this.kf = kf;
}
public void reset() {
i = 0;
}
public void setConstants(PidCoefficients coeffs, ToDoubleFunction<double[]> kf) {
this.coeffs = coeffs;
this.kf = kf;
}
public void setConstants(PidCoefficients coeffs) {
this.coeffs = coeffs;
}
public void set(double newSetPoint) {
setPoint = newSetPoint;
}
public double get() {
return coeffs.kp * e + coeffs.ki * i + coeffs.kd * d + f;
}
public void update(double time, double... x) {
e = setPoint - x[0];
if (!Double.isNaN(lastTime)) {
double dt = time - lastTime;
i += (e + lastE) * dt / 2;
d = (e - lastE) / dt;
}
f = kf.applyAsDouble(x);
lastTime = time;
lastE = e;
}
public void derivUpdate(double time, double d, double... x) {
if (!Double.isNaN(d)) {
this.d = d;
}
e = setPoint - x[0];
if (!Double.isNaN(lastTime)) {
i += (e + lastE) * (time - lastTime) / 2;
}
f = kf.applyAsDouble(x);
lastTime = time;
lastE = e;
}
}