39 #ifndef SPEED_LIMITER_H 40 #define SPEED_LIMITER_H 48 return std::min(std::max(min, x), max);
87 double limit(
double& v,
double v0,
double v1,
double dt);
114 double limit_jerk(
double& v,
double v0,
double v1,
double dt);
137 #endif // SPEED_LIMITER_H
double limit(double &v, double v0, double v1, double dt)
Limit the velocity and acceleration.
SpeedLimiter(bool has_velocity_limits=false, bool has_acceleration_limits=false, bool has_jerk_limits=false, double min_velocity=0.0, double max_velocity=0.0, double min_acceleration=0.0, double max_acceleration=0.0, double min_jerk=0.0, double max_jerk=0.0)
Constructor.
double limit_velocity(double &v)
Limit the velocity.
bool has_acceleration_limits
double limit_acceleration(double &v, double v0, double dt)
Limit the acceleration.
double limit_jerk(double &v, double v0, double v1, double dt)
Limit the jerk.
T clamp(T x, T min, T max)