ViSP  2.9.0

#include <vpAdaptiveGain.h>

## Public Member Functions

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

The formula used to compute the gain is the following :

where , and are constant parameters and is the entry to consider.

The parameters are not set directly. They are computed from three other parameters that are more intuitive to tune:

where represents the gain when , represents the gain when and represents the slope of when .

Examples:

Definition at line 77 of file vpAdaptiveGain.h.

## Constructor & Destructor Documentation

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

Definition at line 69 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Constructor that initializes the gain as constant. In that case .

Parameters
 c : Value of the constant gain.

Definition at line 88 of file vpAdaptiveGain.cpp.

References initFromConstant().

Constructor that initializes the gain as adaptive.

Parameters
 gain_at_zero : the expected gain when : . gain_at_infinity : the expected gain when : . slope_at_zero : the expected slope of when : .

Definition at line 101 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 .

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

Definition at line 115 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

Initializes the parameters with the default value :

Definition at line 134 of file vpAdaptiveGain.cpp.

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

Set the parameters used to compute .

Parameters
 gain_at_zero : the expected gain when : . gain_at_infinity : the expected gain when : . slope_at_zero : the expected slope of when : .
Examples:
servoAfma4Point2DCamVelocityKalman.cpp, and servoViper850Point2DCamVelocityKalman.cpp.

Definition at line 154 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

 double vpAdaptiveGain::limitValue ( void ) const

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

Returns
It returns the value of the gain at infinity.

Definition at line 272 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 ). 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 233 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

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

Operator that computes .

Parameters
 x : Input value to consider. During a visual servo this value can be the euclidian norm or the infinity norm of the task function.
Returns
It returns the value of the computed gain.
value()

Definition at line 304 of file vpAdaptiveGain.cpp.

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

Operator which computes .

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

Definition at line 328 of file vpAdaptiveGain.cpp.

 double vpAdaptiveGain::operator() ( void ) const

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

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

Definition at line 316 of file vpAdaptiveGain.cpp.

Sets the internal parameters in order to obtain a constant gain equal to the gain in 0 set through the parameter .

Returns
It returns the value of the constant gain .

Definition at line 189 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

 double vpAdaptiveGain::value ( double x ) const

Computes the value of the adaptive gain using:

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 or the infinity norm of the task function.
Returns
It returns the value of the computed gain.

Definition at line 255 of file vpAdaptiveGain.cpp.

References vpDEBUG_TRACE.

 double vpAdaptiveGain::value_const ( double x ) const

Computes the value of the adaptive gain using:

Parameters
 x : Input value to consider. During a visual servo this value can be the euclidian norm or the infinity norm of the task function.
Returns
It returns the value of the computed gain.

Definition at line 217 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 .

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

Definition at line 349 of file vpAdaptiveGain.cpp.

## Member Data Documentation

static

Definition at line 83 of file vpAdaptiveGain.h.

Referenced by initFromVoid().