![]() |
WPILibC++ 2027.0.0-alpha-4
|
A Exponential-shaped velocity profile. More...
#include <wpi/math/trajectory/ExponentialProfile.hpp>
Classes | |
| class | ProfileTiming |
| Profile timing. More... | |
| class | Constraints |
| Profile constraints. More... | |
| class | State |
| Profile state. More... | |
Public Types | |
| using | Distance_t = wpi::units::unit_t<Distance> |
| using | Velocity |
| using | Velocity_t = wpi::units::unit_t<Velocity> |
| using | Acceleration |
| using | Input_t = wpi::units::unit_t<Input> |
| using | A_t = wpi::units::unit_t<wpi::units::inverse<wpi::units::seconds>> |
| using | B_t |
| using | KV = wpi::units::compound_unit<Input, wpi::units::inverse<Velocity>> |
| using | kV_t = wpi::units::unit_t<KV> |
| using | KA |
| using | kA_t = wpi::units::unit_t<KA> |
Public Member Functions | |
| constexpr | ExponentialProfile (Constraints constraints) |
| Constructs a ExponentialProfile. | |
| constexpr | ExponentialProfile (const ExponentialProfile &)=default |
| constexpr ExponentialProfile & | operator= (const ExponentialProfile &)=default |
| constexpr | ExponentialProfile (ExponentialProfile &&)=default |
| constexpr ExponentialProfile & | operator= (ExponentialProfile &&)=default |
| constexpr State | Calculate (const wpi::units::second_t &t, const State ¤t, const State &goal) const |
| Calculates the position and velocity for the profile at a time t where the current state is at time t = 0. | |
| constexpr State | CalculateInflectionPoint (const State ¤t, const State &goal) const |
| Calculates the point after which the fastest way to reach the goal state is to apply input in the opposite direction. | |
| constexpr wpi::units::second_t | TimeLeftUntil (const State ¤t, const State &goal) const |
| Calculates the time it will take for this profile to reach the goal state. | |
| constexpr ProfileTiming | CalculateProfileTiming (const State ¤t, const State &goal) const |
| Calculates the time it will take for this profile to reach the inflection point, and the time it will take for this profile to reach the goal state. | |
A Exponential-shaped velocity profile.
While this class can be used for a profiled movement from start to finish, the intended usage is to filter a reference's dynamics based on ExponentialProfile velocity constraints. To compute the reference obeying this constraint, do the following.
Initialization:
Run on update:
where unprofiledReference is free to change between calls. Note that when the unprofiled reference is within the constraints, Calculate() returns the unprofiled reference unchanged.
Otherwise, a timer can be started to provide monotonic values for Calculate() and to determine when the profile has completed via IsFinished().
| using wpi::math::ExponentialProfile< Distance, Input >::A_t = wpi::units::unit_t<wpi::units::inverse<wpi::units::seconds>> |
| using wpi::math::ExponentialProfile< Distance, Input >::Acceleration |
| using wpi::math::ExponentialProfile< Distance, Input >::B_t |
| using wpi::math::ExponentialProfile< Distance, Input >::Distance_t = wpi::units::unit_t<Distance> |
| using wpi::math::ExponentialProfile< Distance, Input >::Input_t = wpi::units::unit_t<Input> |
| using wpi::math::ExponentialProfile< Distance, Input >::KA |
| using wpi::math::ExponentialProfile< Distance, Input >::kA_t = wpi::units::unit_t<KA> |
| using wpi::math::ExponentialProfile< Distance, Input >::KV = wpi::units::compound_unit<Input, wpi::units::inverse<Velocity>> |
| using wpi::math::ExponentialProfile< Distance, Input >::kV_t = wpi::units::unit_t<KV> |
| using wpi::math::ExponentialProfile< Distance, Input >::Velocity |
| using wpi::math::ExponentialProfile< Distance, Input >::Velocity_t = wpi::units::unit_t<Velocity> |
|
inlineexplicitconstexpr |
Constructs a ExponentialProfile.
| constraints | The constraints on the profile, like maximum input. |
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
Calculates the position and velocity for the profile at a time t where the current state is at time t = 0.
| t | How long to advance from the current state toward the desired state. |
| current | The current state. |
| goal | The desired state when the profile is complete. |
|
inlineconstexpr |
Calculates the point after which the fastest way to reach the goal state is to apply input in the opposite direction.
| current | The current state. |
| goal | The desired state when the profile is complete. |
|
inlineconstexpr |
Calculates the time it will take for this profile to reach the inflection point, and the time it will take for this profile to reach the goal state.
| current | The current state. |
| goal | The desired state when the profile is complete. |
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
Calculates the time it will take for this profile to reach the goal state.
| current | The current state. |
| goal | The desired state when the profile is complete. |