jerrym | f157933 | 2013-02-07 01:56:28 +0000 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/
|
| 2 | /* Copyright (c) FIRST 2008. All Rights Reserved. */
|
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */
|
| 4 | /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
| 5 | /*----------------------------------------------------------------------------*/
|
| 6 |
|
| 7 | #ifndef CONTROLLER_H
|
| 8 | #define CONTROLLER_H
|
| 9 |
|
| 10 | #include <vxWorks.h>
|
| 11 |
|
| 12 | /**
|
| 13 | * Interface for Controllers
|
| 14 | * Common interface for controllers. Controllers run control loops, the most common
|
| 15 | * are PID controllers and their variants, but this includes anything that is controlling
|
| 16 | * an actuator in a separate thread.
|
| 17 | */
|
| 18 | class Controller
|
| 19 | {
|
| 20 | public:
|
| 21 | virtual ~Controller() {};
|
| 22 |
|
| 23 | /**
|
| 24 | * Allows the control loop to run
|
| 25 | */
|
| 26 | virtual void Enable() = 0;
|
| 27 |
|
| 28 | /**
|
| 29 | * Stops the control loop from running until explicitly re-enabled by calling enable()
|
| 30 | */
|
| 31 | virtual void Disable() = 0;
|
| 32 | };
|
| 33 |
|
| 34 | #endif
|
| 35 |
|