74 return (maxVoltage -
kS -
kG -
kA * acceleration) /
kV;
91 return (-maxVoltage +
kS -
kG -
kA * acceleration) /
kV;
A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting aga...
Definition: ElevatorFeedforward.h:18
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.
Definition: ElevatorFeedforward.h:88
units::unit_t< kv_unit > kV
Definition: ElevatorFeedforward.h:128
units::meters Distance
Definition: ElevatorFeedforward.h:20
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.
Definition: ElevatorFeedforward.h:105
units::volt_t kS
Definition: ElevatorFeedforward.h:126
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.
Definition: ElevatorFeedforward.h:39
units::compound_unit< Distance, units::inverse< units::seconds > > Velocity
Definition: ElevatorFeedforward.h:22
units::volt_t kG
Definition: ElevatorFeedforward.h:127
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.
Definition: ElevatorFeedforward.h:71
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.
Definition: ElevatorFeedforward.h:121
units::unit_t< ka_unit > kA
Definition: ElevatorFeedforward.h:129
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.
Definition: ElevatorFeedforward.h:51
units::compound_unit< units::volts, units::inverse< Velocity > > kv_unit
Definition: ElevatorFeedforward.h:25
units::compound_unit< Velocity, units::inverse< units::seconds > > Acceleration
Definition: ElevatorFeedforward.h:24
units::compound_unit< units::volts, units::inverse< Acceleration > > ka_unit
Definition: ElevatorFeedforward.h:27
ElevatorFeedforward()=default
typename units::detail::compound_impl< U, Us... >::type compound_unit
Represents a unit type made up from other units.
Definition: base.h:1434
Definition: AprilTagFieldLayout.h:22
constexpr int sgn(T val)
Definition: MathExtras.h:936