47 "kV must be a non-negative number, got {}!",
kV.
value());
53 "kA must be a non-negative number, got {}!",
kA.
value());
83 units::second_t dt)
const {
106 auto plant = LinearSystemId::IdentifyVelocitySystem<Distance>(
kV,
kA);
113 units::volt_t{feedforward.Calculate(r, nextR)(0)};
133 return (maxVoltage -
kS -
kG -
kA * acceleration) /
kV;
150 return (-maxVoltage +
kS -
kG -
kA * acceleration) /
kV;
186 const units::volt_t
kS;
189 const units::volt_t
kG;
A helper class that computes feedforward outputs for a simple elevator (modeled as a motor acting aga...
Definition: ElevatorFeedforward.h:22
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:147
units::meters Distance
Definition: ElevatorFeedforward.h:24
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:164
const units::volt_t kG
The gravity gain.
Definition: ElevatorFeedforward.h:189
const units::volt_t kS
The static gain.
Definition: ElevatorFeedforward.h:186
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:41
units::compound_unit< Distance, units::inverse< units::seconds > > Velocity
Definition: ElevatorFeedforward.h:26
const units::unit_t< ka_unit > kA
The acceleration gain.
Definition: ElevatorFeedforward.h:195
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:130
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:180
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:66
units::compound_unit< units::volts, units::inverse< Velocity > > kv_unit
Definition: ElevatorFeedforward.h:29
const units::unit_t< kv_unit > kV
The velocity gain.
Definition: ElevatorFeedforward.h:192
units::compound_unit< Velocity, units::inverse< units::seconds > > Acceleration
Definition: ElevatorFeedforward.h:28
units::volt_t Calculate(units::unit_t< Velocity > currentVelocity, units::unit_t< Velocity > nextVelocity, units::second_t dt) const
Calculates the feedforward from the gains and setpoints.
Definition: ElevatorFeedforward.h:81
units::compound_unit< units::volts, units::inverse< Acceleration > > ka_unit
Definition: ElevatorFeedforward.h:31
Constructs a plant inversion model-based feedforward from a LinearSystem.
Definition: LinearPlantInversionFeedforward.h:33
constexpr underlying_type value() const noexcept
unit value
Definition: base.h:2107
static void ReportError(const S &format, Args &&... args)
Definition: MathShared.h:60
static void ReportWarning(const S &format, Args &&... args)
Definition: MathShared.h:69
typename units::detail::compound_impl< U, Us... >::type compound_unit
Represents a unit type made up from other units.
Definition: base.h:1434
Definition: AprilTagPoseEstimator.h:15
Eigen::Vector< double, Size > Vectord
Definition: EigenCore.h:12
constexpr int sgn(T val)
Definition: MathExtras.h:624