gain-adaptive.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_GAIN_ADAPTATIVE_HH__
11 #define __SOT_GAIN_ADAPTATIVE_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
19 
20 /* SOT */
22 #include <dynamic-graph/entity.h>
23 
24 /* --------------------------------------------------------------------- */
25 /* --- API ------------------------------------------------------------- */
26 /* --------------------------------------------------------------------- */
27 
28 #if defined(WIN32)
29 #if defined(gain_adaptive_EXPORTS)
30 #define SOTGAINADAPTATIVE_EXPORT __declspec(dllexport)
31 #else
32 #define SOTGAINADAPTATIVE_EXPORT __declspec(dllimport)
33 #endif
34 #else
35 #define SOTGAINADAPTATIVE_EXPORT
36 #endif
37 
38 /* --------------------------------------------------------------------- */
39 /* --- CLASS ----------------------------------------------------------- */
40 /* --------------------------------------------------------------------- */
41 
42 namespace dynamicgraph {
43 namespace sot {
44 
54  public: /* --- CONSTANTS --- */
55  /* Default values. */
56  static const double ZERO_DEFAULT; // = 0.1
57  static const double INFTY_DEFAULT; // = 0.1
58  static const double TAN_DEFAULT; // = 1.
59 
60  public: /* --- ENTITY INHERITANCE --- */
61  static const std::string CLASS_NAME;
62  virtual void display(std::ostream &os) const;
63  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
64 
65  protected:
66  /* Parameters of the adaptative-gain function:
67  * lambda (x) = a * exp (-b*x) + c. */
68  double coeff_a;
69  double coeff_b;
70  double coeff_c;
71 
72  public: /* --- CONSTRUCTORS ---- */
73  GainAdaptive(const std::string &name);
74  GainAdaptive(const std::string &name, const double &lambda);
75  GainAdaptive(const std::string &name, const double &valueAt0,
76  const double &valueAtInfty, const double &tanAt0);
77 
78  public: /* --- INIT --- */
79  inline void init(void) { init(ZERO_DEFAULT, INFTY_DEFAULT, TAN_DEFAULT); }
80  inline void init(const double &lambda) { init(lambda, lambda, 1.); }
81  void init(const double &valueAt0, const double &valueAtInfty,
82  const double &tanAt0);
113  void initFromPassingPoint(const double &valueAt0, const double &valueAtInfty,
114  const double &errorReference,
115  const double &percentage);
116  void forceConstant(void);
117 
118  public: /* --- SIGNALS --- */
121 
122  protected:
123  double &computeGain(double &res, sigtime_t t);
124 
125  private:
126  void addCommands();
127 };
128 
129 } /* namespace sot */
130 } /* namespace dynamicgraph */
131 
132 #endif // #ifndef __SOT_GAIN_ADAPTATIVE_HH__
init
void init(bool compute_local_aabb=true)
dynamicgraph::sot::GainAdaptive::TAN_DEFAULT
static const double TAN_DEFAULT
Definition: gain-adaptive.hh:58
dynamicgraph::sot::GainAdaptive::init
void init(const double &lambda)
Definition: gain-adaptive.hh:80
dynamicgraph::sot::GainAdaptive::errorSIN
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t > errorSIN
Definition: gain-adaptive.hh:119
dynamicgraph::SignalPtr< dynamicgraph::Vector, sigtime_t >
dynamicgraph
SOTGAINADAPTATIVE_EXPORT
#define SOTGAINADAPTATIVE_EXPORT
Definition: gain-adaptive.hh:35
dynamicgraph::Entity
addCommands
void addCommands(boost::python::object obj)
dynamicgraph::sot::GainAdaptive::INFTY_DEFAULT
static const double INFTY_DEFAULT
Definition: gain-adaptive.hh:57
dynamicgraph::sot::GainAdaptive::getClassName
virtual const std::string & getClassName(void) const
Definition: gain-adaptive.hh:63
dynamicgraph::sot::GainAdaptive::init
void init(void)
Definition: gain-adaptive.hh:79
dynamicgraph::sot::GainAdaptive::gainSOUT
dynamicgraph::SignalTimeDependent< double, sigtime_t > gainSOUT
Definition: gain-adaptive.hh:120
dynamicgraph::sigtime_t
int64_t sigtime_t
dynamicgraph::sot::GainAdaptive::ZERO_DEFAULT
static const double ZERO_DEFAULT
Definition: gain-adaptive.hh:56
all-signals.h
display
linear-algebra.h
dynamicgraph::sot::GainAdaptive
Definition: gain-adaptive.hh:53
dynamicgraph::SignalTimeDependent< double, sigtime_t >
dynamicgraph::sot::GainAdaptive::coeff_a
double coeff_a
Definition: gain-adaptive.hh:68
dynamicgraph::sot::GainAdaptive::coeff_b
double coeff_b
Definition: gain-adaptive.hh:69
t
Transform3f t
dynamicgraph::sot::GainAdaptive::CLASS_NAME
static const std::string CLASS_NAME
Definition: gain-adaptive.hh:61
dynamicgraph::sot::GainAdaptive::coeff_c
double coeff_c
Definition: gain-adaptive.hh:70
compile.name
name
Definition: compile.py:23


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31