mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpimath] ProfiledPIDController: Add to SendableRegistry (#4656)
Co-authored-by: Ryan Blue <ryanzblue@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.math.trajectory.TrapezoidProfile;
|
||||
import edu.wpi.first.util.sendable.Sendable;
|
||||
import edu.wpi.first.util.sendable.SendableBuilder;
|
||||
import edu.wpi.first.util.sendable.SendableRegistry;
|
||||
|
||||
/**
|
||||
* Implements a PID control loop whose setpoint is constrained by a trapezoid profile. Users should
|
||||
@@ -52,6 +53,8 @@ public class ProfiledPIDController implements Sendable {
|
||||
m_controller = new PIDController(Kp, Ki, Kd, period);
|
||||
m_constraints = constraints;
|
||||
instances++;
|
||||
|
||||
SendableRegistry.add(this, "ProfiledPIDController", instances);
|
||||
MathSharedStore.reportUsage(MathUsageId.kController_ProfiledPIDController, instances);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user