WPILib 2012
WPILibRoboticsLibraryforFRC
|
#include <SendablePIDController.h>
Public Member Functions | |
SendablePIDController (double p, double i, double d, PIDSource *source, PIDOutput *output) | |
SendablePIDController (double p, double i, double d, PIDSource *source, PIDOutput *output, double period) | |
virtual void | SetSetpoint (float setpoint) |
virtual void | SetPID (double p, double i, double d) |
virtual void | Enable () |
virtual void | Disable () |
virtual std::string | GetType () |
virtual NetworkTable * | GetTable () |
virtual void | ValueChanged (NetworkTable *table, const char *name, NetworkTables_Types type) |
virtual void | ValueConfirmed (NetworkTable *table, const char *name, NetworkTables_Types type) |
A SendablePIDController is a PIDController that can be sent over to the SmartDashboard using the PutData(...) method.
It is useful if you want to test values of a PIDController without having to recompile code between tests. Also, consider using Preferences to save the important values between matches.
SendablePIDController::SendablePIDController | ( | double | p, |
double | i, | ||
double | d, | ||
PIDSource * | source, | ||
PIDOutput * | output, | ||
double | period | ||
) |
Allocate a PID object with the given constants for P, I, D
p | the proportional coefficient |
i | the integral coefficient |
d | the derivative coefficient |
source | The PIDSource object that is used to get values |
output | The PIDOutput object that is set to the output value |
period | the loop time for doing calculations in seconds. This particularly effects calculations of the integral and differential terms. The default is 50ms. |
void SendablePIDController::Disable | ( | ) | [virtual] |
Stop running the PIDController, this sets the output to zero before stopping.
Reimplemented from PIDController.
void SendablePIDController::Enable | ( | ) | [virtual] |
Begin running the PIDController
Reimplemented from PIDController.
void SendablePIDController::SetPID | ( | double | p, |
double | i, | ||
double | d | ||
) | [virtual] |
Set the PID Controller gain parameters. Set the proportional, integral, and differential coefficients.
p | Proportional coefficient |
i | Integral coefficient |
d | Differential coefficient |
void SendablePIDController::SetSetpoint | ( | float | setpoint | ) | [virtual] |
Set the setpoint for the PIDController
setpoint | the desired setpoint |
Reimplemented from PIDController.