WPILib 2012
WPILibRoboticsLibraryforFRC
Public Member Functions
SendablePIDController Class Reference

#include <SendablePIDController.h>

Inheritance diagram for SendablePIDController:
PIDController SmartDashboardData NetworkTableChangeListener

List of all members.

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 NetworkTableGetTable ()
virtual void ValueChanged (NetworkTable *table, const char *name, NetworkTables_Types type)
virtual void ValueConfirmed (NetworkTable *table, const char *name, NetworkTables_Types type)

Detailed Description

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.

See also:
SmartDashboard

Constructor & Destructor Documentation

SendablePIDController::SendablePIDController ( double  p,
double  i,
double  d,
PIDSource source,
PIDOutput output 
)

Allocate a PID object with the given constants for P, I, D, using a 50ms period.

Parameters:
pthe proportional coefficient
ithe integral coefficient
dthe derivative coefficient
sourceThe PIDSource object that is used to get values
outputThe PIDOutput object that is set to the output value
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

Parameters:
pthe proportional coefficient
ithe integral coefficient
dthe derivative coefficient
sourceThe PIDSource object that is used to get values
outputThe PIDOutput object that is set to the output value
periodthe loop time for doing calculations in seconds. This particularly effects calculations of the integral and differential terms. The default is 50ms.

Member Function Documentation

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.

Parameters:
pProportional coefficient
iIntegral coefficient
dDifferential coefficient
void SendablePIDController::SetSetpoint ( float  setpoint) [virtual]

Set the setpoint for the PIDController

Parameters:
setpointthe desired setpoint

Reimplemented from PIDController.


The documentation for this class was generated from the following files:
 All Classes Functions Variables