Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [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 | #pragma once |
| 7 | |
| 8 | /** |
| 9 | * Interface for Controllers |
| 10 | * Common interface for controllers. Controllers run control loops, the most |
| 11 | * common |
| 12 | * are PID controllers and their variants, but this includes anything that is |
| 13 | * controlling |
| 14 | * an actuator in a separate thread. |
| 15 | */ |
| 16 | class Controller { |
| 17 | public: |
| 18 | virtual ~Controller() = default; |
| 19 | |
| 20 | /** |
| 21 | * Allows the control loop to run |
| 22 | */ |
| 23 | virtual void Enable() = 0; |
| 24 | |
| 25 | /** |
| 26 | * Stops the control loop from running until explicitly re-enabled by calling |
| 27 | * enable() |
| 28 | */ |
| 29 | virtual void Disable() = 0; |
| 30 | }; |