WPILibC++  2020.3.2-23-gf6df921
SpeedController.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2019 FIRST. 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 <units/units.h>
11 
12 #include "frc/PIDOutput.h"
13 
14 namespace frc {
15 
19 class SpeedController : public PIDOutput {
20  public:
21  virtual ~SpeedController() = default;
22 
28  virtual void Set(double speed) = 0;
29 
42  virtual void SetVoltage(units::volt_t output);
43 
49  virtual double Get() const = 0;
50 
56  virtual void SetInverted(bool isInverted) = 0;
57 
63  virtual bool GetInverted() const = 0;
64 
68  virtual void Disable() = 0;
69 
73  virtual void StopMotor() = 0;
74 };
75 
76 } // namespace frc
frc::SpeedController::Set
virtual void Set(double speed)=0
Common interface for setting the speed of a speed controller.
frc::SpeedController::StopMotor
virtual void StopMotor()=0
Common interface to stop the motor until Set is called again.
frc::SpeedController::SetInverted
virtual void SetInverted(bool isInverted)=0
Common interface for inverting direction of a speed controller.
frc::SpeedController::GetInverted
virtual bool GetInverted() const =0
Common interface for returning the inversion state of a speed controller.
frc::SpeedController::Get
virtual double Get() const =0
Common interface for getting the current set speed of a speed controller.
frc
A class that enforces constraints on the differential drive kinematics.
Definition: RoboRioSim.h:16
frc::SpeedController
Interface for speed controlling devices.
Definition: SpeedController.h:19
frc::SpeedController::SetVoltage
virtual void SetVoltage(units::volt_t output)
Sets the voltage output of the SpeedController.
frc::SpeedController::Disable
virtual void Disable()=0
Common interface for disabling a motor.
frc::PIDOutput
PIDOutput interface is a generic output for the PID class.
Definition: PIDOutput.h:20