Files
allwpilib/wpilibc/src/main/native/include/SynchronousPID.h
Tyler Veness 630fc55bde Implemented synchronous PID controller (#993)
SynchronousPID provides a Calculate() function for teams to call themselves
instead of running the controller with a Notifier.
2018-05-16 19:51:37 -07:00

34 lines
1.1 KiB
C++

/*----------------------------------------------------------------------------*/
/* 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