WPILibC++  2021.2.2
frc::ElevatorFeedforward< Distance > Class Template Reference

A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting against the force of gravity). More...

#include <ElevatorFeedforward.h>

## Public Types

using Velocity = units::compound_unit< Distance, units::inverse< units::seconds > >

using Acceleration = units::compound_unit< Velocity, units::inverse< units::seconds > >

using kv_unit = units::compound_unit< units::volts, units::inverse< Velocity > >

using ka_unit = units::compound_unit< units::volts, units::inverse< Acceleration > >

## Public Member Functions

constexpr ElevatorFeedforward (units::volt_t kS, units::volt_t kG, units::unit_t< kv_unit > kV, units::unit_t< ka_unit > kA=units::unit_t< ka_unit >(0))
Creates a new ElevatorFeedforward with the specified gains. More...

constexpr units::volt_t Calculate (units::unit_t< Velocity > velocity, units::unit_t< Acceleration > acceleration=units::unit_t< Acceleration >(0))
Calculates the feedforward from the gains and setpoints. More...

constexpr units::unit_t< Velocity > MaxAchievableVelocity (units::volt_t maxVoltage, units::unit_t< Acceleration > acceleration)
Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration. More...

constexpr units::unit_t< Velocity > MinAchievableVelocity (units::volt_t maxVoltage, units::unit_t< Acceleration > acceleration)
Calculates the minimum achievable velocity given a maximum voltage supply and an acceleration. More...

constexpr units::unit_t< Acceleration > MaxAchievableAcceleration (units::volt_t maxVoltage, units::unit_t< Velocity > velocity)
Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity. More...

constexpr units::unit_t< Acceleration > MinAchievableAcceleration (units::volt_t maxVoltage, units::unit_t< Velocity > velocity)
Calculates the minimum achievable acceleration given a maximum voltage supply and a velocity. More...

## Public Attributes

units::volt_t kS {0}

units::volt_t kG {0}

units::unit_t< kv_unit > kV {0}

units::unit_t< ka_unit > kA {0}

## Detailed Description

### template<class Distance> class frc::ElevatorFeedforward< Distance >

A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting against the force of gravity).

## ◆ ElevatorFeedforward()

template<class Distance >
 constexpr frc::ElevatorFeedforward< Distance >::ElevatorFeedforward ( units::volt_t kS, units::volt_t kG, units::unit_t< kv_unit > kV, units::unit_t< ka_unit > kA = units::unit_t(0) )
inlineconstexpr

Creates a new ElevatorFeedforward with the specified gains.

Parameters
 kS The static gain, in volts. kG The gravity gain, in volts. kV The velocity gain, in volt seconds per distance. kA The acceleration gain, in volt seconds^2 per distance.

## ◆ Calculate()

template<class Distance >
 constexpr units::volt_t frc::ElevatorFeedforward< Distance >::Calculate ( units::unit_t< Velocity > velocity, units::unit_t< Acceleration > acceleration = units::unit_t(0) )
inlineconstexpr

Calculates the feedforward from the gains and setpoints.

Parameters
 velocity The velocity setpoint, in distance per second. acceleration The acceleration setpoint, in distance per second^2.
Returns
The computed feedforward, in volts.

## ◆ MaxAchievableAcceleration()

template<class Distance >
 constexpr units::unit_t frc::ElevatorFeedforward< Distance >::MaxAchievableAcceleration ( units::volt_t maxVoltage, units::unit_t< Velocity > velocity )
inlineconstexpr

Calculates the maximum achievable acceleration given a maximum voltage supply and a velocity.

Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.

Parameters
 maxVoltage The maximum voltage that can be supplied to the elevator. velocity The velocity of the elevator.
Returns
The maximum possible acceleration at the given velocity.

## ◆ MaxAchievableVelocity()

template<class Distance >
 constexpr units::unit_t frc::ElevatorFeedforward< Distance >::MaxAchievableVelocity ( units::volt_t maxVoltage, units::unit_t< Acceleration > acceleration )
inlineconstexpr

Calculates the maximum achievable velocity given a maximum voltage supply and an acceleration.

Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.

Parameters
 maxVoltage The maximum voltage that can be supplied to the elevator. acceleration The acceleration of the elevator.
Returns
The maximum possible velocity at the given acceleration.

## ◆ MinAchievableAcceleration()

template<class Distance >
 constexpr units::unit_t frc::ElevatorFeedforward< Distance >::MinAchievableAcceleration ( units::volt_t maxVoltage, units::unit_t< Velocity > velocity )
inlineconstexpr

Calculates the minimum achievable acceleration given a maximum voltage supply and a velocity.

Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the velocity constraint, and this will give you a simultaneously-achievable acceleration constraint.

Parameters
 maxVoltage The maximum voltage that can be supplied to the elevator. velocity The velocity of the elevator.
Returns
The minimum possible acceleration at the given velocity.

## ◆ MinAchievableVelocity()

template<class Distance >
 constexpr units::unit_t frc::ElevatorFeedforward< Distance >::MinAchievableVelocity ( units::volt_t maxVoltage, units::unit_t< Acceleration > acceleration )
inlineconstexpr

Calculates the minimum achievable velocity given a maximum voltage supply and an acceleration.

Useful for ensuring that velocity and acceleration constraints for a trapezoidal profile are simultaneously achievable - enter the acceleration constraint, and this will give you a simultaneously-achievable velocity constraint.

Parameters
 maxVoltage The maximum voltage that can be supplied to the elevator. acceleration The acceleration of the elevator.
Returns
The minimum possible velocity at the given acceleration.

The documentation for this class was generated from the following file:
• /home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/include/frc/controller/ElevatorFeedforward.h