mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
PIDController now supports composition (#976)
For example, an outer position feedback controller can now drive the reference of an inner velocity feedback controller.
This commit is contained in:
committed by
Peter Johnson
parent
5cc7573574
commit
df182f382e
@@ -16,14 +16,13 @@
|
||||
#include "Base.h"
|
||||
#include "Filters/LinearDigitalFilter.h"
|
||||
#include "PIDInterface.h"
|
||||
#include "PIDOutput.h"
|
||||
#include "PIDSource.h"
|
||||
#include "SmartDashboard/SendableBase.h"
|
||||
#include "Timer.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
class PIDOutput;
|
||||
|
||||
/**
|
||||
* Class implements a PID Control Loop.
|
||||
*
|
||||
@@ -34,7 +33,7 @@ class PIDOutput;
|
||||
* in the integral and derivative calculations. Therefore, the sample rate
|
||||
* affects the controller's behavior for a given set of PID constants.
|
||||
*/
|
||||
class PIDBase : public SendableBase, public PIDInterface {
|
||||
class PIDBase : public SendableBase, public PIDInterface, public PIDOutput {
|
||||
public:
|
||||
PIDBase(double p, double i, double d, PIDSource& source, PIDOutput& output);
|
||||
PIDBase(double p, double i, double d, double f, PIDSource& source,
|
||||
@@ -83,6 +82,8 @@ class PIDBase : public SendableBase, public PIDInterface {
|
||||
|
||||
void Reset() override;
|
||||
|
||||
void PIDWrite(double output) override;
|
||||
|
||||
void InitSendable(SendableBuilder& builder) override;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user