ros2_control - rolling
Public Member Functions | List of all members
diff_drive_controller::SpeedLimiter Class Reference

Public Member Functions

 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. More...
 
 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. More...
 
double limit (double &v, double v0, double v1, double dt)
 Limit the velocity and acceleration. More...
 
double limit_velocity (double &v)
 Limit the velocity. More...
 
double limit_acceleration (double &v, double v0, double dt)
 Limit the acceleration. More...
 
double limit_jerk (double &v, double v0, double v1, double dt)
 Limit the jerk. More...
 

Constructor & Destructor Documentation

◆ SpeedLimiter() [1/2]

diff_drive_controller::SpeedLimiter::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() 
)
inline

Constructor.

Parameters
[in]has_velocity_limitsif true, applies velocity limits
[in]has_acceleration_limitsif true, applies acceleration limits
[in]has_jerk_limitsif true, applies jerk limits
[in]min_velocityMinimum velocity [m/s], usually <= 0
[in]max_velocityMaximum velocity [m/s], usually >= 0
[in]max_decelerationMaximum deceleration [m/s^2], usually <= 0
[in]max_accelerationMaximum acceleration [m/s^2], usually >= 0
[in]min_jerkMinimum jerk [m/s^3], usually <= 0
[in]max_jerkMaximum jerk [m/s^3], usually >= 0

◆ SpeedLimiter() [2/2]

diff_drive_controller::SpeedLimiter::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() 
)
inline

Constructor.

Parameters
[in]min_velocityMinimum velocity [m/s], usually <= 0
[in]max_velocityMaximum velocity [m/s], usually >= 0
[in]max_acceleration_reverseMaximum acceleration in reverse direction [m/s^2], usually <= 0
[in]max_accelerationMaximum acceleration [m/s^2], usually >= 0
[in]max_decelerationMaximum deceleration [m/s^2], usually <= 0
[in]max_deceleration_reverseMaximum deceleration in reverse direction [m/s^2], usually >= 0
[in]min_jerkMinimum jerk [m/s^3], usually <= 0
[in]max_jerkMaximum jerk [m/s^3], usually >= 0

Member Function Documentation

◆ limit()

double diff_drive_controller::SpeedLimiter::limit ( double &  v,
double  v0,
double  v1,
double  dt 
)
inline

Limit the velocity and acceleration.

Parameters
[in,out]vVelocity [m/s]
[in]v0Previous velocity to v [m/s]
[in]v1Previous velocity to v0 [m/s]
[in]dtTime step [s]
Returns
Limiting factor (1.0 if none)

◆ limit_acceleration()

double diff_drive_controller::SpeedLimiter::limit_acceleration ( double &  v,
double  v0,
double  dt 
)
inline

Limit the acceleration.

Parameters
[in,out]vVelocity [m/s]
[in]v0Previous velocity [m/s]
[in]dtTime step [s]
Returns
Limiting factor (1.0 if none)

◆ limit_jerk()

double diff_drive_controller::SpeedLimiter::limit_jerk ( double &  v,
double  v0,
double  v1,
double  dt 
)
inline

Limit the jerk.

Parameters
[in,out]vVelocity [m/s]
[in]v0Previous velocity to v [m/s]
[in]v1Previous velocity to v0 [m/s]
[in]dtTime step [s]
Returns
Limiting factor (1.0 if none)
See also
http://en.wikipedia.org/wiki/Jerk_%28physics%29#Motion_control

◆ limit_velocity()

double diff_drive_controller::SpeedLimiter::limit_velocity ( double &  v)
inline

Limit the velocity.

Parameters
[in,out]vVelocity [m/s]
Returns
Limiting factor (1.0 if none)

The documentation for this class was generated from the following file: