4#include <units/angle.h>
6#include <units/length.h>
7#include <units/voltage.h>
9#include <wpi/MathExtras.h>
11#include "rmb/motorcontrol/feedforward/Feedforward.h"
18template <
typename DistanceUnit>
53 : kS(kS), kG(kG), kV(kV), kA(kA) {}
66 return kS * wpi::sgn(velocity) + kG + kV * velocity + kA * acceleration;
81 return (maxVoltage - kS - kG - kA * acceleration) / kV;
96 return (-maxVoltage + kS - kG - kA * acceleration) / kV;
109 units::volt_t maxVoltage,
Velocity_t velocity,
111 return (maxVoltage - kS * wpi::sgn(velocity) - kG - kV * velocity) / kA;
124 units::volt_t maxVoltage,
Velocity_t velocity,
163 return kS * wpi::sgn(velocity) + kG;
Definition ElevatorFeedforward.h:19
Ka_t getAcclerationGain() const override
Definition ElevatorFeedforward.h:145
Velocity_t maxAchievableVelocity(units::volt_t maxVoltage, Acceleration_t acceleration, Distance_t position=Distance_t(0.0)) const override
Definition ElevatorFeedforward.h:79
typename Feedforward< DistanceUnit >::KvUnit KvUnit
Definition ElevatorFeedforward.h:36
typename Feedforward< DistanceUnit >::Kv_t Kv_t
Definition ElevatorFeedforward.h:38
typename Feedforward< DistanceUnit >::KsUnit KsUnit
Definition ElevatorFeedforward.h:32
typename Feedforward< DistanceUnit >:: Acceleration_t Acceleration_t
Definition ElevatorFeedforward.h:29
Acceleration_t maxAchievableAcceleration(units::volt_t maxVoltage, Velocity_t velocity, Distance_t position=Distance_t(0.0)) const override
Definition ElevatorFeedforward.h:108
units::volt_t calculate(Velocity_t velocity, Distance_t distance=Distance_t(0.0), Acceleration_t acceleration=Acceleration_t(0.0)) const override
Definition ElevatorFeedforward.h:64
typename Feedforward< DistanceUnit >::Ka_t Ka_t
Definition ElevatorFeedforward.h:42
typename Feedforward< DistanceUnit >::KaUnit KaUnit
Definition ElevatorFeedforward.h:40
typename Feedforward< DistanceUnit >::Ks_t Ks_t
Definition ElevatorFeedforward.h:34
typename Feedforward< DistanceUnit >:: Distance_t Distance_t
Definition ElevatorFeedforward.h:21
Acceleration_t minAchievableAcceleration(units::volt_t maxVoltage, Velocity_t velocity, Distance_t position=Distance_t(0.0)) const override
Definition ElevatorFeedforward.h:123
units::volt_t calculateStatic(Velocity_t velocity, Distance_t position=Distance_t(0)) const override
Definition ElevatorFeedforward.h:161
Kv_t getVelocityGain() const override
Definition ElevatorFeedforward.h:136
typename Feedforward< DistanceUnit >:: AccelerationUnit AccelerationUnit
Definition ElevatorFeedforward.h:27
typename Feedforward< DistanceUnit >:: VelocityUnit VelocityUnit
Definition ElevatorFeedforward.h:23
Velocity_t minAchievableVelocity(units::volt_t maxVoltage, Acceleration_t acceleration, Distance_t position=Distance_t(0.0)) const override
Definition ElevatorFeedforward.h:94
ElevatorFeedforward(Ks_t kS, Ks_t kG, Kv_t kV, Ka_t kA)
Definition ElevatorFeedforward.h:52
typename Feedforward< DistanceUnit >:: Velocity_t Velocity_t
Definition ElevatorFeedforward.h:25
Definition Feedforward.h:15
the master namespace of librmb
Definition LogitechGamepad.h:9