mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpimath] Add constraints support to ProfiledPIDController Sendable implementation (#6354)
This commit is contained in:
@@ -52,15 +52,25 @@ void glass::DisplayProfiledPIDController(ProfiledPIDControllerModel* m) {
|
||||
double value = d->GetValue();
|
||||
createTuningParameter("D", &value, [=](auto v) { m->SetD(v); });
|
||||
}
|
||||
if (auto s = m->GetGoalData()) {
|
||||
double value = s->GetValue();
|
||||
createTuningParameter("Goal", &value, [=](auto v) { m->SetGoal(v); });
|
||||
}
|
||||
if (auto s = m->GetIZoneData()) {
|
||||
double value = s->GetValue();
|
||||
createTuningParameterNoFilter("IZone", &value,
|
||||
[=](auto v) { m->SetIZone(v); });
|
||||
}
|
||||
if (auto s = m->GetMaxVelocityData()) {
|
||||
double value = s->GetValue();
|
||||
createTuningParameter("Max Velocity", &value,
|
||||
[=](auto v) { m->SetMaxVelocity(v); });
|
||||
}
|
||||
if (auto s = m->GetMaxAccelerationData()) {
|
||||
double value = s->GetValue();
|
||||
createTuningParameter("Max Acceleration", &value,
|
||||
[=](auto v) { m->SetMaxAcceleration(v); });
|
||||
}
|
||||
if (auto s = m->GetGoalData()) {
|
||||
double value = s->GetValue();
|
||||
createTuningParameter("Goal", &value, [=](auto v) { m->SetGoal(v); });
|
||||
}
|
||||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(96, 96, 96, 255));
|
||||
ImGui::Text("Unknown PID Controller");
|
||||
|
||||
Reference in New Issue
Block a user