Visual Servoing Platform
version 3.6.1 under development (2024-12-06)
|
#include <visp3/vs/vpAdaptiveGain.h>
Public Member Functions | |
vpAdaptiveGain () | |
VP_EXPLICIT | 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) |
Adaptive gain computation.
As described in [23], a varying gain could be used in the visual servoing control law
with
where:
As described in Tutorial: How to boost your visual servo control law, the interest of Using an adaptive gain is to reduce the time to convergence in order to speed up the servo.
The following example shows how to use this class in order to use an adaptive gain with the following parameters , and .
This other example shows how to use this class in order to set a constant gain that will ensure an exponential decrease of the task error.
Definition at line 121 of file vpAdaptiveGain.h.
vpAdaptiveGain::vpAdaptiveGain | ( | ) |
Basic constructor which initializes all the parameters with their default value:
Definition at line 52 of file vpAdaptiveGain.cpp.
References initFromVoid().
vpAdaptiveGain::vpAdaptiveGain | ( | double | c | ) |
Constructor that initializes the gain as constant. In that case .
c | : Value of the constant gain. A typical value is 0.5. |
Definition at line 59 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.
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 61 of file vpAdaptiveGain.cpp.
References initStandard().
|
inline |
Gets the last adaptive gain value which was stored in the class.
Definition at line 261 of file vpAdaptiveGain.h.
void vpAdaptiveGain::initFromConstant | ( | double | c | ) |
Initializes the parameters to have a constant gain. In that case .
c | : Value of the constant gain. A typical value is 0.5. |
Definition at line 67 of file vpAdaptiveGain.cpp.
Referenced by vpAdaptiveGain().
void vpAdaptiveGain::initFromVoid | ( | void | ) |
Initializes the parameters with the default value :
Definition at line 75 of file vpAdaptiveGain.cpp.
References DEFAULT_LAMBDA_INFINITY, DEFAULT_LAMBDA_SLOPE, DEFAULT_LAMBDA_ZERO, and initStandard().
Referenced by vpAdaptiveGain().
void vpAdaptiveGain::initStandard | ( | double | gain_at_zero, |
double | gain_at_infinity, | ||
double | slope_at_zero | ||
) |
Set the parameters used to compute .
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 82 of file vpAdaptiveGain.cpp.
Referenced by initFromVoid(), and vpAdaptiveGain().
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.
Definition at line 129 of file vpAdaptiveGain.cpp.
References limitValue_const().
Referenced by operator()().
double vpAdaptiveGain::limitValue_const | ( | void | ) | const |
Gets the value of the gain at infinity (ie the value of ). This function is similar to limitValue() except that here the value is not stored as a parameter of the class.
Definition at line 115 of file vpAdaptiveGain.cpp.
Referenced by limitValue().
double vpAdaptiveGain::operator() | ( | const vpColVector & | x | ) | const |
Operator which computes where
x | : Input vector to consider. |
Definition at line 140 of file vpAdaptiveGain.cpp.
References vpColVector::infinityNorm(), and value().
double vpAdaptiveGain::operator() | ( | double | x | ) | const |
Operator that computes where
x | : Input value to consider. During a visual servo this value can be the Euclidean norm or the infinity norm of the task function. |
Definition at line 136 of file vpAdaptiveGain.cpp.
References value().
double vpAdaptiveGain::operator() | ( | void | ) | const |
Gets the value of the gain at infinity (ie the value of ).
Definition at line 138 of file vpAdaptiveGain.cpp.
References limitValue().
double vpAdaptiveGain::setConstant | ( | void | ) |
Sets the internal parameters in order to obtain a constant gain equal to the gain in 0 set through the parameter .
Definition at line 97 of file vpAdaptiveGain.cpp.
double vpAdaptiveGain::value | ( | double | x | ) | const |
Computes the value of the adaptive gain using:
This value is stored as a parameter of the class.
x | : Input value to consider. During a visual servo this value can be the Euclidean norm or the infinity norm of the task function. |
Definition at line 122 of file vpAdaptiveGain.cpp.
References value_const().
Referenced by operator()().
double vpAdaptiveGain::value_const | ( | double | x | ) | const |
Computes the value of the adaptive gain using:
x | : Input value to consider. During a visual servo this value can be the Euclidean norm or the infinity norm of the task function. |
Definition at line 108 of file vpAdaptiveGain.cpp.
Referenced by value().
|
friend |
Prints the adaptive gain parameters .
os | : The stream where to print the adaptive gain parameters. |
lambda | : The adaptive gain containing the parameters to print. |
Definition at line 142 of file vpAdaptiveGain.cpp.
|
static |
Definition at line 125 of file vpAdaptiveGain.h.
Referenced by initFromVoid().
|
static |
Definition at line 126 of file vpAdaptiveGain.h.
Referenced by initFromVoid().
|
static |
Definition at line 124 of file vpAdaptiveGain.h.
Referenced by initFromVoid().