[wpilib] Remove PIDController, PIDOutput, PIDSource

Move them to the old commands vendordep so that PIDCommand and PIDSubsystem
continue to work.

This also removes Filter and LinearDigitalFilter.
This commit is contained in:
Peter Johnson
2021-03-12 15:41:52 -08:00
parent 3abe0b9d49
commit 6b168ab0c8
69 changed files with 30 additions and 1248 deletions

View File

@@ -13,7 +13,6 @@
#include "frc/Counter.h"
#include "frc/ErrorBase.h"
#include "frc/PIDSource.h"
#include "frc/smartdashboard/Sendable.h"
#include "frc/smartdashboard/SendableHelper.h"
@@ -36,11 +35,8 @@ class DigitalOutput;
*/
class Ultrasonic : public ErrorBase,
public Sendable,
public PIDSource,
public SendableHelper<Ultrasonic> {
public:
enum DistanceUnit { kInches = 0, kMilliMeters = 1 };
/**
* Create an instance of the Ultrasonic Sensor.
*
@@ -51,9 +47,8 @@ class Ultrasonic : public ErrorBase,
* @param echoChannel The digital input channel that receives the echo. The
* length of time that the echo is high represents the
* round trip time of the ping, and the distance.
* @param units The units returned in either kInches or kMilliMeters
*/
Ultrasonic(int pingChannel, int echoChannel, DistanceUnit units = kInches);
Ultrasonic(int pingChannel, int echoChannel);
/**
* Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
@@ -63,10 +58,8 @@ class Ultrasonic : public ErrorBase,
* ping. Requires a 10uS pulse to start.
* @param echoChannel The digital input object that times the return pulse to
* determine the range.
* @param units The units returned in either kInches or kMilliMeters
*/
Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel,
DistanceUnit units = kInches);
Ultrasonic(DigitalOutput* pingChannel, DigitalInput* echoChannel);
/**
* Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
@@ -76,10 +69,8 @@ class Ultrasonic : public ErrorBase,
* ping. Requires a 10uS pulse to start.
* @param echoChannel The digital input object that times the return pulse to
* determine the range.
* @param units The units returned in either kInches or kMilliMeters
*/
Ultrasonic(DigitalOutput& pingChannel, DigitalInput& echoChannel,
DistanceUnit units = kInches);
Ultrasonic(DigitalOutput& pingChannel, DigitalInput& echoChannel);
/**
* Create an instance of an Ultrasonic Sensor from a DigitalInput for the echo
@@ -89,11 +80,9 @@ class Ultrasonic : public ErrorBase,
* ping. Requires a 10uS pulse to start.
* @param echoChannel The digital input object that times the return pulse to
* determine the range.
* @param units The units returned in either kInches or kMilliMeters
*/
Ultrasonic(std::shared_ptr<DigitalOutput> pingChannel,
std::shared_ptr<DigitalInput> echoChannel,
DistanceUnit units = kInches);
std::shared_ptr<DigitalInput> echoChannel);
~Ultrasonic() override;
@@ -156,30 +145,6 @@ class Ultrasonic : public ErrorBase,
void SetEnabled(bool enable);
/**
* Set the current DistanceUnit that should be used for the PIDSource base
* object.
*
* @param units The DistanceUnit that should be used.
*/
void SetDistanceUnits(DistanceUnit units);
/**
* Get the current DistanceUnit that is used for the PIDSource base object.
*
* @return The type of DistanceUnit that is being used.
*/
DistanceUnit GetDistanceUnits() const;
/**
* Get the range in the current DistanceUnit for the PIDSource base object.
*
* @return The range in DistanceUnit
*/
double PIDGet() override;
void SetPIDSourceType(PIDSourceType pidSource) override;
void InitSendable(SendableBuilder& builder) override;
private:
@@ -228,7 +193,6 @@ class Ultrasonic : public ErrorBase,
std::shared_ptr<DigitalInput> m_echoChannel;
bool m_enabled = false;
Counter m_counter;
DistanceUnit m_units;
hal::SimDevice m_simDevice;
hal::SimBoolean m_simRangeValid;