blob: 8f46ea47075a60a60c37d8deae38e52de4ac9c94 [file] [log] [blame]
Brian Silverman26e4e522015-12-17 01:56:40 -05001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. All Rights Reserved.
3 */
4/* Open Source Software - may be modified and shared by FRC teams. The code */
5/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
6/*----------------------------------------------------------------------------*/
7#pragma once
8
9enum class PIDSourceType { kDisplacement, kRate };
10
11/**
12 * PIDSource interface is a generic sensor source for the PID class.
13 * All sensors that can be used with the PID class will implement the PIDSource
14 * that
15 * returns a standard value that will be used in the PID code.
16 */
17class PIDSource {
18 public:
19 virtual void SetPIDSourceType(PIDSourceType pidSource);
20 PIDSourceType GetPIDSourceType() const;
21 virtual double PIDGet() = 0;
22
23 protected:
24 PIDSourceType m_pidSource = PIDSourceType::kDisplacement;
25};