41template <
class Distance>
107 units::second_t
TotalTime()
const {
return m_endDeccel; }
128 static bool ShouldFlipAcceleration(
const State& initial,
const State& goal) {
129 return initial.position > goal.position;
133 State Direct(
const State& in)
const {
135 result.position *= m_direction;
136 result.velocity *= m_direction;
143 Constraints m_constraints;
147 units::second_t m_endAccel;
148 units::second_t m_endFullSpeed;
149 units::second_t m_endDeccel;
Definition: TrapezoidProfile.h:52
Constraints()
Definition: TrapezoidProfile.h:54
Velocity_t maxVelocity
Definition: TrapezoidProfile.h:63
Constraints(Velocity_t maxVelocity_, Acceleration_t maxAcceleration_)
Definition: TrapezoidProfile.h:58
Acceleration_t maxAcceleration
Definition: TrapezoidProfile.h:64
Definition: TrapezoidProfile.h:67
Velocity_t velocity
Definition: TrapezoidProfile.h:70
bool operator==(const State &) const =default
Distance_t position
Definition: TrapezoidProfile.h:69
A trapezoid-shaped velocity profile.
Definition: TrapezoidProfile.h:42
TrapezoidProfile & operator=(const TrapezoidProfile &)=default
units::compound_unit< Velocity, units::inverse< units::seconds > > Acceleration
Definition: TrapezoidProfile.h:49
units::compound_unit< Distance, units::inverse< units::seconds > > Velocity
Definition: TrapezoidProfile.h:46
TrapezoidProfile(const TrapezoidProfile &)=default
State Calculate(units::second_t t) const
Calculate the correct position and velocity for the profile at a time t where the beginning of the pr...
Definition: TrapezoidProfile.inc:62
TrapezoidProfile(Constraints constraints, State goal, State initial=State{Distance_t{0}, Velocity_t{0}})
Construct a TrapezoidProfile.
Definition: TrapezoidProfile.inc:14
units::second_t TimeLeftUntil(Distance_t target) const
Returns the time left until a target distance in the profile is reached.
Definition: TrapezoidProfile.inc:91
units::second_t TotalTime() const
Returns the total time the profile takes to reach the goal.
Definition: TrapezoidProfile.h:107
bool IsFinished(units::second_t t) const
Returns true if the profile has reached the goal.
Definition: TrapezoidProfile.h:117
TrapezoidProfile & operator=(TrapezoidProfile &&)=default
units::unit_t< Velocity > Velocity_t
Definition: TrapezoidProfile.h:47
TrapezoidProfile(TrapezoidProfile &&)=default
static void ReportUsage(MathUsageId id, int count)
Definition: MathShared.h:73
typename units::detail::compound_impl< U, Us... >::type compound_unit
Represents a unit type made up from other units.
Definition: base.h:1445
result
Definition: format.h:2564
Definition: AprilTagPoseEstimator.h:15
@ kTrajectory_TrapezoidProfile