WPILibC++  2019.1.1-beta-4-15-g8ac4b11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
PIDSource.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2018 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 namespace frc {
11 
12 enum class PIDSourceType { kDisplacement, kRate };
13 
20 class PIDSource {
21  public:
22  virtual ~PIDSource() = default;
23 
29  virtual void SetPIDSourceType(PIDSourceType pidSource);
30 
31  virtual PIDSourceType GetPIDSourceType() const;
32 
33  virtual double PIDGet() = 0;
34 
35  protected:
36  PIDSourceType m_pidSource = PIDSourceType::kDisplacement;
37 };
38 
39 } // namespace frc
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
PIDSource interface is a generic sensor source for the PID class.
Definition: PIDSource.h:20
virtual void SetPIDSourceType(PIDSourceType pidSource)
Set which parameter you are using as a process control variable.