35 #ifndef DWB_PLUGINS_ONE_D_VELOCITY_ITERATOR_H 36 #define DWB_PLUGINS_ONE_D_VELOCITY_ITERATOR_H 56 inline double projectVelocity(
double v0,
double accel,
double decel,
double dt,
double target)
62 return std::min(target, v1);
67 return std::max(target, v1);
98 OneDVelocityIterator(
double current,
double min,
double max,
double acc_limit,
double decel_limit,
double acc_time,
105 else if (current > max)
118 num_samples = std::max(2, num_samples);
177 #endif // DWB_PLUGINS_ONE_D_VELOCITY_ITERATOR_H
An iterator for generating a number of samples in a range.
double getVelocity() const
Get the next velocity available.
OneDVelocityIterator & operator++()
Increment the iterator.
void reset()
Reset back to the first velocity.
OneDVelocityIterator(double current, double min, double max, double acc_limit, double decel_limit, double acc_time, int num_samples)
Constructor for the velocity iterator.
double projectVelocity(double v0, double accel, double decel, double dt, double target)
Given initial conditions and a time, figure out the end velocity.