Brian Silverman | 26e4e52 | 2015-12-17 01:56:40 -0500 | [diff] [blame^] | 1 | /*----------------------------------------------------------------------------*/ |
| 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 | |
| 9 | enum 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 | */ |
| 17 | class 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 | }; |