mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Update LiveWindow to provide continuous telemetry. (#771)
LiveWindow.updateValues() is now called from IterativeRobotBase on every loop iteration. Telemetry for all WPILib classes is enabled by default; it can be disabled for specific classes using LiveWindow.disableTelemetry(), or all telemetry can be disabled using LiveWindow.disableAllTelemetry(). This necessitated changing the hook methodology into other classes to be more property-based rather than each class providing multiple functions. This had the benefit of reducing boilerplate and increasing consistency. - Remove NamedSendable, add name to Sendable. - Provide SendableBase abstract class. - Deprecate LiveWindow addSensor/addActuator interfaces. - Add LiveWindow support to drive classes. - Add addChild() helper functions to Subsystem. - Fix inheritance hierarchy. Now only sensors inherit from SensorBase. Other devices inherit from some combination of SendableBase, ErrorBase, or nothing.
This commit is contained in:
@@ -23,6 +23,7 @@ PIDSubsystem::PIDSubsystem(const std::string& name, double p, double i,
|
||||
double d)
|
||||
: Subsystem(name) {
|
||||
m_controller = std::make_shared<PIDController>(p, i, d, this, this);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,6 +39,7 @@ PIDSubsystem::PIDSubsystem(const std::string& name, double p, double i,
|
||||
double d, double f)
|
||||
: Subsystem(name) {
|
||||
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,7 @@ PIDSubsystem::PIDSubsystem(const std::string& name, double p, double i,
|
||||
: Subsystem(name) {
|
||||
m_controller =
|
||||
std::make_shared<PIDController>(p, i, d, f, this, this, period);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,6 +75,7 @@ PIDSubsystem::PIDSubsystem(const std::string& name, double p, double i,
|
||||
PIDSubsystem::PIDSubsystem(double p, double i, double d)
|
||||
: Subsystem("PIDSubsystem") {
|
||||
m_controller = std::make_shared<PIDController>(p, i, d, this, this);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,6 +91,7 @@ PIDSubsystem::PIDSubsystem(double p, double i, double d)
|
||||
PIDSubsystem::PIDSubsystem(double p, double i, double d, double f)
|
||||
: Subsystem("PIDSubsystem") {
|
||||
m_controller = std::make_shared<PIDController>(p, i, d, f, this, this);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,6 +111,7 @@ PIDSubsystem::PIDSubsystem(double p, double i, double d, double f,
|
||||
: Subsystem("PIDSubsystem") {
|
||||
m_controller =
|
||||
std::make_shared<PIDController>(p, i, d, f, this, this, period);
|
||||
AddChild("PIDController", m_controller);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,10 +239,3 @@ double PIDSubsystem::GetRate() { return ReturnPIDInput(); }
|
||||
void PIDSubsystem::PIDWrite(double output) { UsePIDOutput(output); }
|
||||
|
||||
double PIDSubsystem::PIDGet() { return ReturnPIDInput(); }
|
||||
|
||||
std::string PIDSubsystem::GetSmartDashboardType() const { return "PIDCommand"; }
|
||||
|
||||
void PIDSubsystem::InitTable(std::shared_ptr<nt::NetworkTable> subtable) {
|
||||
m_controller->InitTable(subtable);
|
||||
Subsystem::InitTable(subtable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user