ViSP  2.10.0

#include <vpAdaptiveGain.h>

Public Member Functions

 vpAdaptiveGain ()
 
 vpAdaptiveGain (double c)
 
 vpAdaptiveGain (double gain_at_zero, double gain_at_infinity, double slope_at_zero)
 
void initFromConstant (double c)
 
void initFromVoid (void)
 
void initStandard (double gain_at_zero, double gain_at_infinity, double slope_at_zero)
 
double setConstant (void)
 
double value_const (double x) const
 
double value (double x) const
 
double limitValue_const (void) const
 
double limitValue (void) const
 
double getLastValue (void) const
 
double operator() (double x) const
 
double operator() (const vpColVector &x) const
 
double operator() (void) const
 

Static Public Attributes

static const double DEFAULT_LAMBDA_ZERO = 1.666
 
static const double DEFAULT_LAMBDA_INFINITY = 0.1666
 
static const double DEFAULT_LAMBDA_SLOPE = 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 constant parameters and $ x $ is the entry to consider.

The parameters $a,b,c$ are not set directly. They are computed from three other parameters $\lambda(0), \lambda(\infty), {\dot \lambda}(0)$ that are more intuitive to tune:

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

\[ b = {\dot \lambda}(0) / a \]

\[ c = \lambda(\infty) \]

where $ \lambda(0)$ represents the gain when $x=0$, $ \lambda(\infty)$ represents the gain when $x=\infty$ and $ {\dot \lambda}(0)$ represents the slope of $\lambda(x)$ when $x=0$.

Examples:
servoAfma4Point2DCamVelocityKalman.cpp, servoViper850Point2DCamVelocityKalman.cpp, tutorial-ibvs-4pts-plotter-continuous-gain-adaptive.cpp, and tutorial-ibvs-4pts-plotter-gain-adaptive.cpp.

Definition at line 77 of file vpAdaptiveGain.h.

Constructor & Destructor Documentation

vpAdaptiveGain::vpAdaptiveGain ( )

Basic constructor which initializes all the parameters with their default value:

Definition at line 69 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

vpAdaptiveGain::vpAdaptiveGain ( double  c)

Constructor that initializes the gain as constant. In that case $\lambda(x) = c$.

Parameters
c: Value of the constant gain.

Definition at line 88 of file vpAdaptiveGain.cpp.

References initFromConstant().

vpAdaptiveGain::vpAdaptiveGain ( double  gain_at_zero,
double  gain_at_infinity,
double  slope_at_zero 
)

Constructor that initializes the gain as adaptive.

Parameters
gain_at_zero: the expected gain when $x=0$: $\lambda(0)$.
gain_at_infinity: the expected gain when $x=\infty$: $\lambda(\infty)$.
slope_at_zero: the expected slope of $\lambda(x)$ when $x=0$: ${\dot \lambda}(0)$.

Definition at line 106 of file vpAdaptiveGain.cpp.

References initStandard().

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 159 of file vpAdaptiveGain.h.

void vpAdaptiveGain::initFromConstant ( double  c)

Initializes the parameters to have a constant gain. In that case $\lambda(x) = c$.

Parameters
c: Value of the constant gain.
Examples:
servoAfma4Point2DCamVelocityKalman.cpp.

Definition at line 125 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Referenced by vpAdaptiveGain().

void vpAdaptiveGain::initFromVoid ( void  )
void vpAdaptiveGain::initStandard ( double  gain_at_zero,
double  gain_at_infinity,
double  slope_at_zero 
)

Set the parameters $\lambda(0), \lambda(\infty), {\dot \lambda}(0)$ used to compute $\lambda(x)$.

Parameters
gain_at_zero: the expected gain when $x=0$: $\lambda(0)$.
gain_at_infinity: the expected gain when $x=\infty$: $\lambda(\infty)$.
slope_at_zero: the expected slope of $\lambda(x)$ when $x=0$: ${\dot \lambda}(0)$.
Examples:
servoAfma4Point2DCamVelocityKalman.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 164 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Referenced by vpAdaptiveGain().

double vpAdaptiveGain::limitValue ( void  ) const

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

Returns
It returns the value of the gain at infinity.

Definition at line 282 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 $ \lambda(\infty) = c $). Similar to limitValue() except that here the value is not stored as a parameter of the class.

Returns
It returns the value of the gain at infinity.

Definition at line 243 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::operator() ( double  x) const

Operator that computes $\lambda(x)$.

Parameters
x: Input value to consider. During a visual servo this value can be the euclidian norm $||s - s^*||$ or the infinity norm $||s - s^*||_{\infty}$ of the task function.
Returns
It returns the value of the computed gain.
See also
value()

Definition at line 314 of file vpAdaptiveGain.cpp.

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

Operator which computes $\lambda({||x||}_{\infty})$.

Parameters
x: Input vector to consider.
Returns
It returns the value of the computed gain.

Definition at line 338 of file vpAdaptiveGain.cpp.

double vpAdaptiveGain::operator() ( void  ) const

Gets the value of the gain at infinity (ie the value of $\lambda(\infty) = c $).

Returns
It returns the value of the gain at infinity.
See also
limitValue()

Definition at line 326 of file vpAdaptiveGain.cpp.

double vpAdaptiveGain::setConstant ( void  )

Sets the internal parameters $a,b,c$ in order to obtain a constant gain equal to the gain in 0 set through the parameter $\lambda(0)$.

Returns
It returns the value of the constant gain $\lambda(0)$.

Definition at line 199 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::value ( double  x) const

Computes the value of the adaptive gain $\lambda(x)$ using:

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

This value is stored as a parameter of the class.

Parameters
x: Input value to consider. During a visual servo this value can be the euclidian norm $||s - s^*||$ or the infinity norm $||s - s^*||_{\infty}$ of the task function.
Returns
It returns the value of the computed gain.

Definition at line 265 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

double vpAdaptiveGain::value_const ( double  x) const

Computes the value of the adaptive gain $\lambda(x)$ using:

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

Parameters
x: Input value to consider. During a visual servo this value can be the euclidian norm $||s - s^*||$ or the infinity norm $||s - s^*||_{\infty}$ of the task function.
Returns
It returns the value of the computed gain.

Definition at line 227 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 parameters $\lambda(0), \lambda(\infty), {\dot \lambda}(0)$.

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

Definition at line 359 of file vpAdaptiveGain.cpp.

Member Data Documentation

const double vpAdaptiveGain::DEFAULT_LAMBDA_INFINITY = 0.1666
static

Definition at line 83 of file vpAdaptiveGain.h.

Referenced by initFromVoid().

const double vpAdaptiveGain::DEFAULT_LAMBDA_SLOPE = 1.666
static

Definition at line 84 of file vpAdaptiveGain.h.

Referenced by initFromVoid().

const double vpAdaptiveGain::DEFAULT_LAMBDA_ZERO = 1.666
static

Definition at line 82 of file vpAdaptiveGain.h.

Referenced by initFromVoid().