blob: 1f849c17d953af62bfe9edde85950ebb5dc46507 [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
10namespace frc {
11
12enum class PIDSourceType { kDisplacement, kRate };
13
14/**
15 * PIDSource interface is a generic sensor source for the PID class.
16 * All sensors that can be used with the PID class will implement the PIDSource
17 * that returns a standard value that will be used in the PID code.
18 */
19class PIDSource {
20 public:
21 virtual void SetPIDSourceType(PIDSourceType pidSource);
22 PIDSourceType GetPIDSourceType() const;
23 virtual double PIDGet() = 0;
24
25 protected:
26 PIDSourceType m_pidSource = PIDSourceType::kDisplacement;
27};
28
29} // namespace frc