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 | #include "PIDOutput.h" |
| 9 | |
| 10 | /** |
| 11 | * Interface for speed controlling devices. |
| 12 | */ |
| 13 | class SpeedController : public PIDOutput |
| 14 | { |
| 15 | public: |
| 16 | virtual ~SpeedController() = default; |
| 17 | /** |
| 18 | * Common interface for setting the speed of a speed controller. |
| 19 | * |
| 20 | * @param speed The speed to set. Value should be between -1.0 and 1.0. |
| 21 | * @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately. |
| 22 | */ |
| 23 | virtual void Set(float speed, uint8_t syncGroup = 0) = 0; |
| 24 | /** |
| 25 | * Common interface for getting the current set speed of a speed controller. |
| 26 | * |
| 27 | * @return The current set speed. Value is between -1.0 and 1.0. |
| 28 | */ |
| 29 | virtual float Get() const = 0; |
| 30 | /** |
| 31 | * Common interface for disabling a motor. |
| 32 | */ |
| 33 | virtual void Disable() = 0; |
| 34 | }; |