Gazebo Math

API Reference

8.0.0
SpeedLimiter Class Reference

Class to limit velocity, acceleration and jerk. More...

#include <SpeedLimiter.hh>

Public Member Functions

 SpeedLimiter ()
 Constructor. There are no limits by default.
 
double Limit (double &_vel, double _prevVel, double _prevPrevVel, std::chrono::steady_clock::duration _dt) const
 Limit velocity, acceleration and jerk.
 
double LimitAcceleration (double &_vel, double _prevVel, std::chrono::steady_clock::duration _dt) const
 Limit the acceleration using a first-order backward difference method.
 
double LimitJerk (double &_vel, double _prevVel, double _prevPrevVel, std::chrono::steady_clock::duration _dt) const
 Limit the jerk using a second-order backward difference method.
 
double LimitVelocity (double &_vel) const
 Limit the velocity.
 
double MaxAcceleration () const
 Get maximum acceleration limit, defaults to positive infinity.
 
double MaxJerk () const
 Get maximum jerk limit, defaults to positive infinity.
 
double MaxVelocity () const
 Get maximum velocity limit, defaults to positive infinity.
 
double MinAcceleration () const
 Get minimum acceleration limit, defaults to negative infinity.
 
double MinJerk () const
 Get minimum jerk limit, defaults to negative infinity.
 
double MinVelocity () const
 Get minimum velocity limit, defaults to negative infinity.
 
void SetMaxAcceleration (double _lim)
 Set maximum acceleration limit in m/s^2, usually >= 0.
 
void SetMaxJerk (double _lim)
 Set maximum jerk limit in m/s^3, usually >= 0.
 
void SetMaxVelocity (double _lim)
 Set maximum velocity limit in m/s, usually >= 0.
 
void SetMinAcceleration (double _lim)
 Set minimum acceleration limit in m/s^2, usually <= 0.
 
void SetMinJerk (double _lim)
 Set minimum jerk limit in m/s^3, usually <= 0.
 
void SetMinVelocity (double _lim)
 Set minimum velocity limit in m/s, usually <= 0.
 

Detailed Description

Class to limit velocity, acceleration and jerk.

Constructor & Destructor Documentation

◆ SpeedLimiter()

Constructor. There are no limits by default.

Member Function Documentation

◆ Limit()

double Limit ( double _vel,
double  _prevVel,
double  _prevPrevVel,
std::chrono::steady_clock::duration  _dt 
) const

Limit velocity, acceleration and jerk.

Parameters
[in,out]_velVelocity to limit [m/s].
[in]_prevVelPrevious velocity to _vel [m/s].
[in]_prevPrevVelPrevious velocity to _prevVel [m/s].
[in]_dtTime step.
Returns
Limiting difference, which is (out _vel - in _vel).

◆ LimitAcceleration()

double LimitAcceleration ( double _vel,
double  _prevVel,
std::chrono::steady_clock::duration  _dt 
) const

Limit the acceleration using a first-order backward difference method.

Parameters
[in,out]_velVelocity [m/s].
[in]_prevVelPrevious velocity [m/s].
[in]_dtTime step.
Returns
Limiting difference, which is (out _vel - in _vel).

◆ LimitJerk()

double LimitJerk ( double _vel,
double  _prevVel,
double  _prevPrevVel,
std::chrono::steady_clock::duration  _dt 
) const

Limit the jerk using a second-order backward difference method.

Parameters
[in,out]_velVelocity to limit [m/s].
[in]_prevVelPrevious velocity to v [m/s].
[in]_prevPrevVelPrevious velocity to prevVel [m/s].
[in]_dtTime step.
Returns
Limiting difference, which is (out _vel - in _vel).
See also
http://en.wikipedia.org/wiki/Jerk_%28physics%29#Motion_control.

◆ LimitVelocity()

double LimitVelocity ( double _vel) const

Limit the velocity.

Parameters
[in,out]_velVelocity to limit [m/s].
Returns
Limiting difference, which is (out _vel - in _vel).

◆ MaxAcceleration()

double MaxAcceleration ( ) const

Get maximum acceleration limit, defaults to positive infinity.

Returns
Maximum acceleration.

◆ MaxJerk()

double MaxJerk ( ) const

Get maximum jerk limit, defaults to positive infinity.

Returns
Maximum jerk.

◆ MaxVelocity()

double MaxVelocity ( ) const

Get maximum velocity limit, defaults to positive infinity.

Returns
Maximum velocity.

◆ MinAcceleration()

double MinAcceleration ( ) const

Get minimum acceleration limit, defaults to negative infinity.

Returns
Minimum acceleration.

◆ MinJerk()

double MinJerk ( ) const

Get minimum jerk limit, defaults to negative infinity.

Returns
Minimum jerk.

◆ MinVelocity()

double MinVelocity ( ) const

Get minimum velocity limit, defaults to negative infinity.

Returns
Minimum velocity.

◆ SetMaxAcceleration()

void SetMaxAcceleration ( double  _lim)

Set maximum acceleration limit in m/s^2, usually >= 0.

Parameters
[in]_limMaximum acceleration.

◆ SetMaxJerk()

void SetMaxJerk ( double  _lim)

Set maximum jerk limit in m/s^3, usually >= 0.

Parameters
[in]_limMaximum jerk.

◆ SetMaxVelocity()

void SetMaxVelocity ( double  _lim)

Set maximum velocity limit in m/s, usually >= 0.

Parameters
[in]_limMaximum velocity.

◆ SetMinAcceleration()

void SetMinAcceleration ( double  _lim)

Set minimum acceleration limit in m/s^2, usually <= 0.

Parameters
[in]_limMinimum acceleration.

◆ SetMinJerk()

void SetMinJerk ( double  _lim)

Set minimum jerk limit in m/s^3, usually <= 0.

Parameters
[in]_limMinimum jerk.

◆ SetMinVelocity()

void SetMinVelocity ( double  _lim)

Set minimum velocity limit in m/s, usually <= 0.

Parameters
[in]_limMinimum velocity.

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