mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
SynchronousPID provides a Calculate() function for teams to call themselves instead of running the controller with a Notifier.
34 lines
1.1 KiB
C++
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
|