blob: 1a2be9c86201df0174f2836d0608aac3f45b4576 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05002/* Copyright (c) FIRST 2008-2016. All Rights Reserved. */
Brian Silverman26e4e522015-12-17 01:56:40 -05003/* Open Source Software - may be modified and shared by FRC teams. The code */
Brian Silverman1a675112016-02-20 20:42:49 -05004/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
Brian Silverman26e4e522015-12-17 01:56:40 -05006/*----------------------------------------------------------------------------*/
Brian Silverman1a675112016-02-20 20:42:49 -05007
Brian Silverman26e4e522015-12-17 01:56:40 -05008#pragma once
9
10enum class PIDSourceType { kDisplacement, kRate };
11
12/**
13 * PIDSource interface is a generic sensor source for the PID class.
14 * All sensors that can be used with the PID class will implement the PIDSource
15 * that
16 * returns a standard value that will be used in the PID code.
17 */
18class PIDSource {
19 public:
20 virtual void SetPIDSourceType(PIDSourceType pidSource);
21 PIDSourceType GetPIDSourceType() const;
22 virtual double PIDGet() = 0;
23
24 protected:
25 PIDSourceType m_pidSource = PIDSourceType::kDisplacement;
26};