19 #ifndef DIFF_DRIVE_CONTROLLER__SPEED_LIMITER_HPP_
20 #define DIFF_DRIVE_CONTROLLER__SPEED_LIMITER_HPP_
24 #include "control_toolbox/rate_limiter.hpp"
26 namespace diff_drive_controller
44 bool has_velocity_limits =
true,
bool has_acceleration_limits =
true,
45 bool has_jerk_limits =
true,
double min_velocity = std::numeric_limits<double>::quiet_NaN(),
46 double max_velocity = std::numeric_limits<double>::quiet_NaN(),
47 double max_deceleration = std::numeric_limits<double>::quiet_NaN(),
48 double max_acceleration = std::numeric_limits<double>::quiet_NaN(),
49 double min_jerk = std::numeric_limits<double>::quiet_NaN(),
50 double max_jerk = std::numeric_limits<double>::quiet_NaN())
52 if (!has_velocity_limits)
54 min_velocity = max_velocity = std::numeric_limits<double>::quiet_NaN();
56 if (!has_acceleration_limits)
58 max_deceleration = max_acceleration = std::numeric_limits<double>::quiet_NaN();
62 min_jerk = max_jerk = std::numeric_limits<double>::quiet_NaN();
65 min_velocity, max_velocity, max_deceleration, max_acceleration,
66 std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN(), min_jerk,
84 double min_velocity = std::numeric_limits<double>::quiet_NaN(),
85 double max_velocity = std::numeric_limits<double>::quiet_NaN(),
86 double max_acceleration_reverse = std::numeric_limits<double>::quiet_NaN(),
87 double max_acceleration = std::numeric_limits<double>::quiet_NaN(),
88 double max_deceleration = std::numeric_limits<double>::quiet_NaN(),
89 double max_deceleration_reverse = std::numeric_limits<double>::quiet_NaN(),
90 double min_jerk = std::numeric_limits<double>::quiet_NaN(),
91 double max_jerk = std::numeric_limits<double>::quiet_NaN())
94 min_velocity, max_velocity, max_acceleration_reverse, max_acceleration, max_deceleration,
95 max_deceleration_reverse, min_jerk, max_jerk);
106 double limit(
double & v,
double v0,
double v1,
double dt)
108 return speed_limiter_.
limit(v, v0, v1, dt);
139 double limit_jerk(
double & v,
double v0,
double v1,
double dt)
Definition: speed_limiter.hpp:29
double limit_jerk(double &v, double v0, double v1, double dt)
Limit the jerk.
Definition: speed_limiter.hpp:139
double limit(double &v, double v0, double v1, double dt)
Limit the velocity and acceleration.
Definition: speed_limiter.hpp:106
SpeedLimiter(double min_velocity=std::numeric_limits< double >::quiet_NaN(), double max_velocity=std::numeric_limits< double >::quiet_NaN(), double max_acceleration_reverse=std::numeric_limits< double >::quiet_NaN(), double max_acceleration=std::numeric_limits< double >::quiet_NaN(), double max_deceleration=std::numeric_limits< double >::quiet_NaN(), double max_deceleration_reverse=std::numeric_limits< double >::quiet_NaN(), double min_jerk=std::numeric_limits< double >::quiet_NaN(), double max_jerk=std::numeric_limits< double >::quiet_NaN())
Constructor.
Definition: speed_limiter.hpp:83
SpeedLimiter(bool has_velocity_limits=true, bool has_acceleration_limits=true, bool has_jerk_limits=true, double min_velocity=std::numeric_limits< double >::quiet_NaN(), double max_velocity=std::numeric_limits< double >::quiet_NaN(), double max_deceleration=std::numeric_limits< double >::quiet_NaN(), double max_acceleration=std::numeric_limits< double >::quiet_NaN(), double min_jerk=std::numeric_limits< double >::quiet_NaN(), double max_jerk=std::numeric_limits< double >::quiet_NaN())
Constructor.
Definition: speed_limiter.hpp:43
double limit_acceleration(double &v, double v0, double dt)
Limit the acceleration.
Definition: speed_limiter.hpp:125
double limit_velocity(double &v)
Limit the velocity.
Definition: speed_limiter.hpp:116