[glass] Add Profiled PID controller support & IZone Support (#5959)

This commit is contained in:
m10653
2023-12-22 14:29:25 -05:00
committed by GitHub
parent bcef6c5398
commit 43fb6e9f87
11 changed files with 303 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
#include "glass/networktables/NTMechanism2D.h"
#include "glass/networktables/NTMotorController.h"
#include "glass/networktables/NTPIDController.h"
#include "glass/networktables/NTProfiledPIDController.h"
#include "glass/networktables/NTStringChooser.h"
#include "glass/networktables/NTSubsystem.h"
#include "glass/networktables/NetworkTablesProvider.h"
@@ -141,6 +142,18 @@ void glass::AddStandardNetworkTablesViews(NetworkTablesProvider& provider) {
DisplayPIDController(static_cast<NTPIDControllerModel*>(model));
});
});
provider.Register(
NTProfiledPIDControllerModel::kType,
[](nt::NetworkTableInstance inst, const char* path) {
return std::make_unique<NTProfiledPIDControllerModel>(inst, path);
},
[](Window* win, Model* model, const char* path) {
win->SetFlags(ImGuiWindowFlags_AlwaysAutoResize);
return MakeFunctionView([=] {
DisplayProfiledPIDController(
static_cast<NTProfiledPIDControllerModel*>(model));
});
});
provider.Register(
NTMotorControllerModel::kType,
[](nt::NetworkTableInstance inst, const char* path) {