Clean up PIDCommand (#2010)

PIDCommand uses a function based (callback) model, so functions designed for use in derived classes are of limited utility.
This commit is contained in:
Oblarg
2019-11-01 16:11:55 -04:00
committed by Peter Johnson
parent 9ebd23d61e
commit c5186d8159
6 changed files with 11 additions and 150 deletions

View File

@@ -63,51 +63,6 @@ class PIDCommand : public CommandHelper<CommandBase, PIDCommand> {
void End(bool interrupted) override;
/**
* Sets the function that uses the output of the PIDController.
*
* @param useOutput The function that uses the output.
*/
void SetOutput(std::function<void(double)> useOutput);
/**
* Sets the setpoint for the controller to track the given source.
*
* @param setpointSource The setpoint source
*/
void SetSetpoint(std::function<double()> setpointSource);
/**
* Sets the setpoint for the controller to a constant value.
*
* @param setpoint The setpoint
*/
void SetSetpoint(double setpoint);
/**
* Sets the setpoint for the controller to a constant value relative (i.e.
* added to) the current setpoint.
*
* @param relativeReference The change in setpoint
*/
void SetSetpointRelative(double relativeSetpoint);
/**
* Gets the measurement of the process variable. Wraps the passed-in function
* for readability.
*
* @return The measurement of the process variable
*/
virtual double GetMeasurement();
/**
* Gets the measurement of the process variable. Wraps the passed-in function
* for readability.
*
* @return The measurement of the process variable
*/
virtual void UseOutput(double output);
/**
* Returns the PIDController used by the command.
*

View File

@@ -100,22 +100,6 @@ class ProfiledPIDCommand
void End(bool interrupted) override;
/**
* Gets the measurement of the process variable. Wraps the passed-in function
* for readability.
*
* @return The measurement of the process variable
*/
virtual units::meter_t GetMeasurement();
/**
* Gets the measurement of the process variable. Wraps the passed-in function
* for readability.
*
* @return The measurement of the process variable
*/
virtual void UseOutput(double output, State state);
/**
* Returns the ProfiledPIDController used by the command.
*