Implemented synchronous PID controller (#993)

SynchronousPID provides a Calculate() function for teams to call themselves
instead of running the controller with a Notifier.
This commit is contained in:
Tyler Veness
2018-05-16 19:51:37 -07:00
committed by Peter Johnson
parent f90e429bf9
commit 630fc55bde
11 changed files with 1698 additions and 1379 deletions

View File

@@ -0,0 +1,33 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#pragma once
#include "PIDBase.h"
namespace frc {
/**
* Class implements a synchronous PID control loop.
*
* Provides a calculate method for the user to call at their desired update
* rate.
*/
class SynchronousPID : public PIDBase {
public:
SynchronousPID(double Kp, double Ki, double Kd, PIDSource& source,
PIDOutput& output);
SynchronousPID(double Kp, double Ki, double Kd, double Kf, PIDSource& source,
PIDOutput& output);
SynchronousPID(const SynchronousPID&) = delete;
SynchronousPID& operator=(const SynchronousPID) = delete;
void Calculate() override;
};
} // namespace frc