mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user