ViSP  2.6.2

#include <vpAdaptiveGain.h>

Public Member Functions

 vpAdaptiveGain (void)
 
void initFromConstant (double lambda)
 
void initFromVoid (void)
 
void initStandard (double en_zero, double en_infini, double pente_en_zero)
 
double setConstant (void)
 
double value_const (double val_e) const
 
double value (double val_e) const
 
double limitValue_const (void) const
 
double limitValue (void) const
 
double getLastValue (void) const
 
double operator() (double val_e) const
 
double operator() (const vpColVector &e) const
 
double operator() (void) const
 

Static Public Attributes

static const double DEFAULT_LAMBDA_ZERO = 1.666
 
static const double DEFAULT_LAMBDA_INFINI = 0.1666
 
static const double DEFAULT_LAMBDA_PENTE = 1.666
 

Friends

VISP_EXPORT std::ostream & operator<< (std::ostream &os, const vpAdaptiveGain &lambda)
 

Detailed Description

Adaptive gain computation.

The formula used to compute the gain is the following :

\[ lambda (x) = a * exp (-b*x) + c \]

where $ a $, $ b $ and $ c $ are parameters which must be set and $ x $ is the vector error of the task.

By default, the parameters are set with default values:

\[ a = lambda(0) - lambda(inf) \]

\[ b = lambda'(0) / a \]

\[ c = lambda(inf) \]

with $ lambda(0) = 1.666 $, $ lambda(inf) = 0.1666 $ and $ lambda'(0) = 1.666 $.

$ lambda(0)$ represents the gain in 0, $ lambda(inf)$ represents the gain to infinity and $ lambda'(0)$ represents the slope in 0.

Examples:
servoAfma4Point2DCamVelocityKalman.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 78 of file vpAdaptiveGain.h.

Constructor & Destructor Documentation

vpAdaptiveGain::vpAdaptiveGain ( void  )

Basic constructor which initializes the parameters with a default value.

Definition at line 66 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Member Function Documentation

double vpAdaptiveGain::getLastValue ( void  ) const
inline

Gets the last adaptive gain value which was stored in the class.

Returns
It returns the last adaptive gain value which was stored in the class.

Definition at line 155 of file vpAdaptiveGain.h.

void vpAdaptiveGain::initFromConstant ( double  lambda)

Initializes the parameters to have a constant gain. Thus $ a = 0 $, $ b = 1 $ and $ c = lambda $

Parameters
lambda: the expected constant gain.
Examples:
servoAfma4Point2DCamVelocityKalman.cpp.

Definition at line 90 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

void vpAdaptiveGain::initFromVoid ( void  )

Initializes the parameters with the default value :

  • $ lambda(0) = 1.666 $
  • $ lambda(inf) = 0.1666 $
  • $ lambda'(0) = 1.666 $

Definition at line 110 of file vpAdaptiveGain.cpp.

References DEFAULT_LAMBDA_INFINI, DEFAULT_LAMBDA_PENTE, DEFAULT_LAMBDA_ZERO, and vpDEBUG_TRACE.

void vpAdaptiveGain::initStandard ( double  en_zero,
double  en_infini,
double  pente_en_zero 
)

Computes the parameters thanks to the given $ lambda(0)$, $ lambda(inf)$ and $ lambda'(0)$.

$ lambda(0)$ represents the gain in 0, $ lambda(inf)$ represents the gain to infinity and $ lambda'(0)$ represents the slope in 0.

Parameters
en_zero: the expected gain in 0.
en_infini: the expected gain to infinity.
pente_en_zero: the expected slope in 0.
Examples:
servoAfma4Point2DCamVelocityKalman.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 133 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::limitValue ( void  ) const

Gets the value of the gain at infinity (ie the value of $ c $)and stores it as a parameter of the class.

Returns
It returns the value of the gain at infinity (ie the value of $ c $).

Definition at line 256 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::limitValue_const ( void  ) const

Gets the value of the gain at infinity (ie the value of $ c $).

Returns
It returns the value of the gain at infinity (ie the value of $ c $).

Definition at line 214 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::operator() ( double  val_e) const

Operator which calls the value(double val_e) method with val_e in parameter in order to compute the adaptive gain corresponding to val_e.

Parameters
val_e: Norm of the task function $\mid s - s^*\mid$.
Returns
It returns the value of the computed gain.

Definition at line 287 of file vpAdaptiveGain.cpp.

double vpAdaptiveGain::operator() ( const vpColVector e) const

Operator which calls the value(double val_e) method with the infinity norm of e in parameter in order to compute the adaptive gain corresponding to $ |e| $.

Parameters
e: the task function $\mid s - s^*\mid$.
Returns
It returns the value of the computed gain.

Definition at line 312 of file vpAdaptiveGain.cpp.

double vpAdaptiveGain::operator() ( void  ) const

Gets the value of the gain at infinity (ie the value of $ c $).

Returns
It returns the value of the gain at infinity (ie the value of $ c $).

Definition at line 298 of file vpAdaptiveGain.cpp.

double vpAdaptiveGain::setConstant ( void  )

Sets the parameters in order to obtain a constant gain equal to the gain in 0.

Returns
It returns the value of the computed constant gain.

Definition at line 168 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::value ( double  val_e) const

Computes the value of the adaptive gain $\lambda$ corresponding to the norm of the task function and stores it as a parameter of the class. The formula used for the gain computation is the following:

\[\lambda = a * exp(-b*val_e) + c\]

Parameters
val_e: Norm of the task function $\mid s - s^*\mid$.
Returns
It returns the value of the computed gain.

Definition at line 238 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::value_const ( double  val_e) const

Computes the value of the adaptive gain $\lambda$ corresponding to the norm of the task function. The formula is the following:

\[\lambda = a * exp(-b*val_e) + c\]

Parameters
val_e: Norm of the task function $\mid s - s^*\mid$.
Returns
It returns the value of the computed gain.

Definition at line 197 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Friends And Related Function Documentation

VISP_EXPORT std::ostream& operator<< ( std::ostream &  os,
const vpAdaptiveGain lambda 
)
friend

Prints the adaptive gain coefficients. It prints the gain in 0, the gain to infinity and the slope in 0.

Parameters
os: The stream where to print the adaptive gain parameters.
lambda: The adaptive gain containing the parameters to print.

Definition at line 335 of file vpAdaptiveGain.cpp.

Member Data Documentation

const double vpAdaptiveGain::DEFAULT_LAMBDA_INFINI = 0.1666
static

Definition at line 84 of file vpAdaptiveGain.h.

Referenced by initFromVoid().

const double vpAdaptiveGain::DEFAULT_LAMBDA_PENTE = 1.666
static

Definition at line 85 of file vpAdaptiveGain.h.

Referenced by initFromVoid().

const double vpAdaptiveGain::DEFAULT_LAMBDA_ZERO = 1.666
static

Definition at line 83 of file vpAdaptiveGain.h.

Referenced by initFromVoid().