Public Member Functions | Private Types | Private Attributes | List of all members
MotionModel Class Reference

This class defines a motion model, with the motion limits. More...

#include <motion.hpp>

Public Member Functions

void applyAccelerationFactors (double &trans_vel, double &rot_vel, const double &trans_fact, const double &rot_fact, const double &time_step) const
 Modify translation and rotation given velocities, applying the extremal accelerations multiplied by the given factors during the given time step. More...
 
void applyAccelerations (double &trans_vel, double &rot_vel, const double &trans_acc, const double &rot_acc, const double &time_step) const
 Modify translation and rotation given velocities, applying the given accelerations during the given time step. More...
 
double limAcc (const double &lim_dist, const double &dist, const double &vel, const double &ldr_vel, const double &time_step) const
 Descriptive method, giving the limit acceleration which ensure to avoid reaching limit distance for a given distance, velocity and leader velocity. More...
 
const double & maxRotAcc () const
 Descriptive method, giving the maximum rotation acceleration. More...
 
const double & maxRotVel () const
 Descriptive method, giving the maximum rotation velocity. More...
 
const double & maxTranslAcc () const
 Descriptive method, giving the maximum translation acceleration. More...
 
const double & maxTranslVel () const
 Descriptive method, giving the maximum translation velocity. More...
 
const double & minRotAcc () const
 Descriptive method, giving the minimum rotation acceleration (or maximum rotation deceleration). More...
 
const double & minTranslAcc () const
 Descriptive method, giving the minimum translation acceleration (or maximum translation deceleration). More...
 
const double & minTranslVel () const
 Descriptive method, giving the minimum translation velocity. More...
 
 MotionModel (const double &max_v, const double &max_omega, const double &max_a, const double &max_gamma)
 Minimum constructor, supposing that minimum velocities and accelerations is the opposite of the maxima. More...
 
 MotionModel (const double &min_v, const double &max_v, const double &max_omega, const double &min_a, const double &max_a, const double &min_gamma, const double &max_gamma)
 General constructor, supposing that minimum velocities and accelerations are not the opposite of the maxima. More...
 
void set (const double values[nbLimits])
 Set the motion's limits. More...
 

Private Types

enum  Limits {
  vMin, vMax, omMax, aMin,
  aMax, gmMin, gmMax, nbLimits
}
 These are the indexes of the array of limits. More...
 

Private Attributes

double limits [nbLimits]
 The array of limits. More...
 

Detailed Description

This class defines a motion model, with the motion limits.

Rotation velocity has symmetric limits: minimum value is the opposite of the maximum value. Regarding both accelerations (translation and rotation), maximum acceleration limits the increase of the absolute value of the related velocity, while deceleration concerns the decrease of the absolute value.

Since
0.2.2

Definition at line 28 of file motion.hpp.

Member Enumeration Documentation

enum MotionModel::Limits
private

These are the indexes of the array of limits.

Enumerator
vMin 

Index of the minimum translation velocity.

vMax 

Index of the maximum translation velocity.

omMax 

Index of the maximum rotation velocity.

aMin 

Index of the maximum translation deceleration.

aMax 

Index of the maximum translation acceleration.

gmMin 

Index of the maximum rotation deceleration.

gmMax 

Index of the maximum rotation acceleration.

nbLimits 

Number of limits in the array.

Definition at line 32 of file motion.hpp.

Constructor & Destructor Documentation

MotionModel::MotionModel ( const double &  max_v,
const double &  max_omega,
const double &  max_a,
const double &  max_gamma 
)
inline

Minimum constructor, supposing that minimum velocities and accelerations is the opposite of the maxima.

Parameters
max_vthe maximum translation velocity (and opposite of the minimum translation velocity),
max_omegathe maximum rotation velocity,
max_athe maximum translation acceleration (and opposite of the minimum translation acceleration),
max_gammathe maximum rotation acceleration (and opposite of the minimum rotation acceleration).

Definition at line 59 of file motion.hpp.

MotionModel::MotionModel ( const double &  min_v,
const double &  max_v,
const double &  max_omega,
const double &  min_a,
const double &  max_a,
const double &  min_gamma,
const double &  max_gamma 
)
inline

General constructor, supposing that minimum velocities and accelerations are not the opposite of the maxima.

Parameters
min_vthe minimum translation velocity,
max_vthe maximum translation velocity,
max_omegathe maximum rotation velocity,
min_athe minimum translation acceleration (or maximum translation deceleration),
max_athe maximum translation acceleration,
min_gammathe minimum rotation acceleration (or maximum rotation deceleration),
max_gammathe maximum rotation acceleration.

Definition at line 77 of file motion.hpp.

Member Function Documentation

void MotionModel::applyAccelerationFactors ( double &  trans_vel,
double &  rot_vel,
const double &  trans_fact,
const double &  rot_fact,
const double &  time_step 
) const

Modify translation and rotation given velocities, applying the extremal accelerations multiplied by the given factors during the given time step.

A factor of the same sign than the velocity is multiplied by the maximum acceleration to improve the velocity in absolute value, while a factor whose sign is the opposite of the velocity's is multiplied by the maximum deceleration to reduce the velocity in absolute value. Extrema of the velocity are taken into account, as well as a possible change of sign of the velocity during the change (it changes the applied acceleration for the remaining time).

Parameters
trans_velthe translation velocity, to update,
rot_velthe rotation velocity, to update,
trans_factthe translation factor, multiplied by one of the translation acceleration extrema,
rot_factthe rotation factor, multiplied by one of the rotation acceleration extrema,
time_stepthe duration of the accelerations.

Definition at line 77 of file motion.cpp.

void MotionModel::applyAccelerations ( double &  trans_vel,
double &  rot_vel,
const double &  trans_acc,
const double &  rot_acc,
const double &  time_step 
) const

Modify translation and rotation given velocities, applying the given accelerations during the given time step.

Extrema of the velocity and of the acceleration are taken into account, as well as a possible change of sign of the velocity during the change (it changes the acceleration extrema for the remaining time).

Parameters
trans_velthe translation velocity, to update,
rot_velthe rotation velocity, to update,
trans_accthe translation acceleration,
rot_accthe rotation acceleration,
time_stepthe duration of the accelerations.

Definition at line 129 of file motion.cpp.

double MotionModel::limAcc ( const double &  lim_dist,
const double &  dist,
const double &  vel,
const double &  ldr_vel,
const double &  time_step 
) const

Descriptive method, giving the limit acceleration which ensure to avoid reaching limit distance for a given distance, velocity and leader velocity.

Parameters
lim_distthe limit (minimum) distance allowed,
distthe current distance to the leader,
velthe current velocity of the robot,
ldr_velthe current velocity of the leader,
time_stepthe time step of the motion.

Definition at line 21 of file motion.cpp.

const double& MotionModel::maxRotAcc ( ) const
inline

Descriptive method, giving the maximum rotation acceleration.

See also
aMax.

Definition at line 114 of file motion.hpp.

const double& MotionModel::maxRotVel ( ) const
inline

Descriptive method, giving the maximum rotation velocity.

See also
omMax.

Definition at line 96 of file motion.hpp.

const double& MotionModel::maxTranslAcc ( ) const
inline

Descriptive method, giving the maximum translation acceleration.

See also
aMax.

Definition at line 105 of file motion.hpp.

const double& MotionModel::maxTranslVel ( ) const
inline

Descriptive method, giving the maximum translation velocity.

See also
vMax.

Definition at line 92 of file motion.hpp.

const double& MotionModel::minRotAcc ( ) const
inline

Descriptive method, giving the minimum rotation acceleration (or maximum rotation deceleration).

See also
gmMin.

Definition at line 110 of file motion.hpp.

const double& MotionModel::minTranslAcc ( ) const
inline

Descriptive method, giving the minimum translation acceleration (or maximum translation deceleration).

See also
aMin.

Definition at line 101 of file motion.hpp.

const double& MotionModel::minTranslVel ( ) const
inline

Descriptive method, giving the minimum translation velocity.

See also
vMin.

Definition at line 88 of file motion.hpp.

void MotionModel::set ( const double  values[nbLimits])
inline

Set the motion's limits.

Parameters
valuesThe motion's limits in an array of nbLimits doubles, in the order defined by Limits.
See also
limits.

Definition at line 178 of file motion.hpp.

Member Data Documentation

double MotionModel::limits[nbLimits]
private

The array of limits.

Definition at line 44 of file motion.hpp.


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


qt_ctrl
Author(s): Alexis Scheuer
autogenerated on Wed Dec 16 2020 15:51:32