blob: 3458e7f8ff982568927410c38a56fd0712ddea93 [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008-2017. 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 the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#pragma once
9
10#include "PIDOutput.h"
11
12namespace frc {
13
14/**
15 * Interface for speed controlling devices.
16 */
17class SpeedController : public PIDOutput {
18 public:
19 virtual ~SpeedController() = default;
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 */
25 virtual void Set(double speed) = 0;
26
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 double Get() const = 0;
33
34 /**
35 * Common interface for inverting direction of a speed controller.
36 * @param isInverted The state of inversion, true is inverted.
37 */
38 virtual void SetInverted(bool isInverted) = 0;
39 /**
40
41 * Common interface for disabling a motor.
42 */
43 virtual void Disable() = 0;
44
45 /**
46 * Common interface for returning the inversion state of a speed controller.
47 * @return isInverted The state of inversion, true is inverted.
48 */
49 virtual bool GetInverted() const = 0;
50
51 /**
52 * Common interface to stop the motor until Set is called again.
53 */
54 virtual void StopMotor() = 0;
55};
56
57} // namespace frc