ArmFeedforward

A helper class that computes feedforward outputs for a simple arm (modeled as a motor acting against the force of gravity on a beam suspended at an angle), adjusted to use WPIUnits for unit assertion. Source

Since

3.5.0

Constructors

Link copied to clipboard
constructor(kS: Double, kCos: Double, kV: Double, kA: Double)
Creates a new ArmFeedforward with the specified gains.
constructor(kS: Double, kCos: Double, kV: Double)
Creates a new ArmFeedforward with the specified gains.

Functions

Link copied to clipboard
open fun calculate(positionRadians: Double, velocityRadiansPerSecond: Double): Double
Implicit feedforward of assumed radians unit.
open fun calculate(position: Measure<Angle>, velocity: Measure<Velocity<Angle>>): Double
Calculates the feedforward from the gains and velocity setpoint (acceleration is assumed to be zero).
open fun calculate(position: Measure<Angle>, velocity: Measure<Velocity<Angle>>, acceleration: Measure<Velocity<Velocity<Angle>>>): Double
Calculates the feedforward from the gains and setpoints.
Link copied to clipboard
open fun getA(): Double
Acceleration gain.
Link copied to clipboard
Gets the current coefficients for this controller.
Link copied to clipboard
open fun getCos(): Double
Gravity gain.
Link copied to clipboard
open fun getS(): Double
Static gain.
Link copied to clipboard
open fun getV(): Double
Velocity gain.
Link copied to clipboard
Calculates the maximum achievable acceleration given a maximum voltage supply, a position, and a velocity.
Link copied to clipboard
open fun maxAchievableVelocity(maxVoltage: Measure<Voltage>, angle: Measure<Angle>, acceleration: Measure<Velocity<Velocity<Angle>>>): Measure<Velocity<Angle>>
Calculates the maximum achievable velocity given a maximum voltage supply, a position, and an acceleration.
Link copied to clipboard
Calculates the minimum achievable acceleration given a maximum voltage supply, a position, and a velocity.
Link copied to clipboard
open fun minAchievableVelocity(maxVoltage: Measure<Voltage>, angle: Measure<Angle>, acceleration: Measure<Velocity<Velocity<Angle>>>): Measure<Velocity<Angle>>
Calculates the minimum achievable velocity given a maximum voltage supply, a position, and an acceleration.
Link copied to clipboard
open fun reset()
Reset this controller back to an un-accumulated state, if applicable.
Link copied to clipboard
open fun setCoefficients(coeffs: Array<Double>)
Sets the coefficients for this controller.