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