ViSP
Main Page
Related Pages
Modules
Classes
Examples
All
Classes
Functions
Variables
Enumerations
Enumerator
Friends
Groups
Pages
vpAdaptiveGain.h
1
/****************************************************************************
2
*
3
* $Id: vpAdaptiveGain.h 4056 2013-01-05 13:04:42Z fspindle $
4
*
5
* This file is part of the ViSP software.
6
* Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7
*
8
* This software is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public License
10
* ("GPL") version 2 as published by the Free Software Foundation.
11
* See the file LICENSE.txt at the root directory of this source
12
* distribution for additional information about the GNU GPL.
13
*
14
* For using ViSP with software that can not be combined with the GNU
15
* GPL, please contact INRIA about acquiring a ViSP Professional
16
* Edition License.
17
*
18
* See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19
*
20
* This software was developed at:
21
* INRIA Rennes - Bretagne Atlantique
22
* Campus Universitaire de Beaulieu
23
* 35042 Rennes Cedex
24
* France
25
* http://www.irisa.fr/lagadic
26
*
27
* If you have questions regarding the use of this file, please contact
28
* INRIA at visp@inria.fr
29
*
30
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32
*
33
*
34
* Description:
35
* Adaptive gain.
36
*
37
* Authors:
38
* Nicolas Mansard
39
*
40
*****************************************************************************/
46
#ifndef __VP_ADAPTIVE_GAIN_H
47
#define __VP_ADAPTIVE_GAIN_H
48
49
#include <visp/vpConfig.h>
50
#include <iostream>
51
52
class
vpColVector
;
78
class
VISP_EXPORT
vpAdaptiveGain
79
{
80
81
public
:
/* constantes */
82
83
static
const
double
DEFAULT_LAMBDA_ZERO
;
84
static
const
double
DEFAULT_LAMBDA_INFINI
;
85
static
const
double
DEFAULT_LAMBDA_PENTE
;
86
87
88
private
:
/* Attributs*/
89
/* Coefficient de la fonction de calcul de lambda.
90
* lambda (x) = a * exp (-b*x) + c. */
91
double
coeff_a;
92
double
coeff_b;
93
double
coeff_c;
94
95
/* Derniere valeur calculee. */
96
mutable
double
lambda;
97
98
99
100
public
:
/* Methodes*/
101
102
/* --- CONSTRUCTOR -------------------------------------------------------- */
103
104
vpAdaptiveGain
(
void
);
105
106
/* --- INIT --------------------------------------------------------------- */
107
void
initFromConstant (
double
lambda);
108
void
initFromVoid (
void
);
109
void
initStandard (
double
en_zero,
110
double
en_infini,
111
double
pente_en_zero);
112
113
114
/* --- MODIFIORS ---------------------------------------------------------- */
115
double
setConstant (
void
);
116
117
118
/* --- COMPUTE ------------------------------------------------------------ */
119
/* \brief Calcule la valeur de lambda au point courrant.
120
*
121
* Determine la valeur du lambda adaptatif en fonction de la valeur
122
* de la norme de la fonction de tache e par extrapolation exponentielle.
123
* La fonction est : (en_infini - en_zero) * exp (-pente * ||e|| ) + en_infini.
124
* On a bien :
125
* - lambda(10^5) = en_infini ;
126
* - lambda(0) = en_zero ;
127
* - lambda(x ~ 0) ~ - pente * x + en_zero.
128
* \param val_e: valeur de la norme de l'erreur.
129
* \return: valeur de gain au point courrant.
130
*/
131
double
value_const (
double
val_e)
const
;
132
133
/* \brief Calcule la valeur de lambda au point courrant et stockage du
134
* resultat.
135
*
136
* La fonction calcule la valeur de lambda d'apres la valeur de la norme
137
* de l'erreur, comme le fait la fonction valeur_const.
138
* La fonction non constante stocke de plus le resultat dans this ->lambda.
139
* \param val_e: valeur de la norme de l'erreur.
140
* \return: valeur de gain au point courrant.
141
*/
142
double
value (
double
val_e)
const
;
143
144
double
limitValue_const (
void
)
const
;
145
146
double
limitValue (
void
)
const
;
147
148
/* --- ACCESSORS ---------------------------------------------------------- */
149
155
inline
double
getLastValue
(
void
)
const
{
return
this
->lambda;}
156
157
double
operator() (
double
val_e)
const
;
158
159
/* \brief Lance la fonction valeur avec la norme INFINIE du vecteur. */
160
double
operator() (
const
vpColVector
& e)
const
;
161
162
/* \brief Idem function limitValue. */
163
double
operator() (
void
)
const
;
164
165
166
/* --- IOSTREAM ----------------------------------------------------------- */
167
168
friend
VISP_EXPORT std::ostream& operator<< (std::ostream &os,
169
const
vpAdaptiveGain
& lambda);
170
};
171
172
#endif
/* __VP_ADAPTIVE_GAIN_H */
173
174
175
176
177
/*
178
* Local variables:
179
* c-basic-offset: 4
180
* End:
181
*/
src
servo
vpAdaptiveGain.h
Generated on Tue Sep 17 2013 00:21:38 for ViSP by
1.8.4