Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 2 | /* Copyright (c) FIRST 2008-2016. All Rights Reserved. */ |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 4 | /* must be accompanied by the FIRST BSD license file in the root directory of */ |
| 5 | /* the project. */ |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 6 | /*----------------------------------------------------------------------------*/ |
Brian Silverman | 1a67511 | 2016-02-20 20:42:49 -0500 | [diff] [blame^] | 7 | |
Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame] | 8 | #pragma once |
| 9 | |
| 10 | enum 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 | */ |
| 18 | class 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 | }; |