mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
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:
committed by
Peter Johnson
parent
f90e429bf9
commit
630fc55bde
33
wpilibc/src/main/native/include/SynchronousPID.h
Normal file
33
wpilibc/src/main/native/include/SynchronousPID.h
Normal 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
|
||||
Reference in New Issue
Block a user