Class PositionFeedforwardController
java.lang.Object
com.stuypulse.stuylib.control.Controller
com.stuypulse.stuylib.control.feedforward.PositionFeedforwardController
A positional controller that uses a feedforward model to calculate motor outputs given positional
setpoints.
The feedforward model takes in velocity setpoints, so the derivative of the positional setpoints must be calculated. This is done implicitly by this controller though.
-
Constructor Summary
ConstructorDescriptionPositionFeedforwardController
(MotorFeedforward feedforward) Create a position controller with a feedforward model -
Method Summary
Modifier and TypeMethodDescriptionprotected double
calculate
(double setpoint, double measurement) Calculates a motor output by feeding the derivative of a positional setpoint to a feedforward modelMethods inherited from class com.stuypulse.stuylib.control.Controller
add, getError, getMeasurement, getOutput, getSetpoint, isDone, setMeasurementFilter, setOutputFilter, setSetpointFilter, update
-
Constructor Details
-
PositionFeedforwardController
Create a position controller with a feedforward model- Parameters:
feedforward
- feedforward model
-
-
Method Details
-
calculate
protected double calculate(double setpoint, double measurement) Calculates a motor output by feeding the derivative of a positional setpoint to a feedforward model- Specified by:
calculate
in classController
- Parameters:
setpoint
- positional setpointmeasurement
- position measurement, which is not used by the feedforward model- Returns:
- motor output from feedforward model
-