blob: 96b6b178305860d6c019914c4dff0f91d0cb1fe5 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
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 */
13class SpeedController : public PIDOutput
14{
15public:
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};