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... | |
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.
Definition at line 28 of file motion.hpp.
|
private |
These are the indexes of the array of limits.
Definition at line 32 of file motion.hpp.
|
inline |
Minimum constructor, supposing that minimum velocities and accelerations is the opposite of the maxima.
max_v | the maximum translation velocity (and opposite of the minimum translation velocity), |
max_omega | the maximum rotation velocity, |
max_a | the maximum translation acceleration (and opposite of the minimum translation acceleration), |
max_gamma | the maximum rotation acceleration (and opposite of the minimum rotation acceleration). |
Definition at line 59 of file motion.hpp.
|
inline |
General constructor, supposing that minimum velocities and accelerations are not the opposite of the maxima.
min_v | the minimum translation velocity, |
max_v | the maximum translation velocity, |
max_omega | the maximum rotation velocity, |
min_a | the minimum translation acceleration (or maximum translation deceleration), |
max_a | the maximum translation acceleration, |
min_gamma | the minimum rotation acceleration (or maximum rotation deceleration), |
max_gamma | the maximum rotation acceleration. |
Definition at line 77 of file motion.hpp.
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).
trans_vel | the translation velocity, to update, |
rot_vel | the rotation velocity, to update, |
trans_fact | the translation factor, multiplied by one of the translation acceleration extrema, |
rot_fact | the rotation factor, multiplied by one of the rotation acceleration extrema, |
time_step | the 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).
trans_vel | the translation velocity, to update, |
rot_vel | the rotation velocity, to update, |
trans_acc | the translation acceleration, |
rot_acc | the rotation acceleration, |
time_step | the 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.
lim_dist | the limit (minimum) distance allowed, |
dist | the current distance to the leader, |
vel | the current velocity of the robot, |
ldr_vel | the current velocity of the leader, |
time_step | the time step of the motion. |
Definition at line 21 of file motion.cpp.
|
inline |
Descriptive method, giving the maximum rotation acceleration.
Definition at line 114 of file motion.hpp.
|
inline |
Descriptive method, giving the maximum rotation velocity.
Definition at line 96 of file motion.hpp.
|
inline |
Descriptive method, giving the maximum translation acceleration.
Definition at line 105 of file motion.hpp.
|
inline |
Descriptive method, giving the maximum translation velocity.
Definition at line 92 of file motion.hpp.
|
inline |
Descriptive method, giving the minimum rotation acceleration (or maximum rotation deceleration).
Definition at line 110 of file motion.hpp.
|
inline |
Descriptive method, giving the minimum translation acceleration (or maximum translation deceleration).
Definition at line 101 of file motion.hpp.
|
inline |
Descriptive method, giving the minimum translation velocity.
Definition at line 88 of file motion.hpp.
|
inline |
Set the motion's limits.
values | The motion's limits in an array of nbLimits doubles, in the order defined by Limits. |
Definition at line 178 of file motion.hpp.
|
private |
The array of limits.
Definition at line 44 of file motion.hpp.