integrator-euler.t.cpp
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 #include <sot/core/factory.hh>
12 
13 using namespace dynamicgraph::sot;
14 using namespace dynamicgraph;
15 
16 #define SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(sotClassType, sotSigType, \
17  sotCoefType, className) \
18  template <> \
19  std::string sotClassType<sotSigType, sotCoefType>::getTypeName(void) { \
20  return #sotSigType; \
21  } \
22  template <> \
23  const std::string sotClassType<sotSigType, sotCoefType>::CLASS_NAME = \
24  className; \
25  template <> \
26  const std::string &sotClassType<sotSigType, sotCoefType>::getClassName(void) \
27  const { \
28  return CLASS_NAME; \
29  } \
30  extern "C" { \
31  Entity *regFunction##_##sotSigType##_##sotCoefType( \
32  const std::string &objname) { \
33  return new sotClassType<sotSigType, sotCoefType>(objname); \
34  } \
35  EntityRegisterer regObj##_##sotSigType##_##sotCoefType( \
36  sotClassType<sotSigType, sotCoefType>::CLASS_NAME, \
37  &regFunction##_##sotSigType##_##sotCoefType); \
38  }
39 
40 using namespace std;
41 namespace dynamicgraph {
42 namespace sot {
44  "IntegratorEulerDoubleDouble")
46  "IntegratorEulerVectorMatrix")
47 SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(IntegratorEuler, Vector, double,
48  "IntegratorEulerVectorDouble")
49 
50 template class IntegratorEuler<double, double>;
51 template class IntegratorEuler<Vector, double>;
52 template class IntegratorEuler<Vector, Matrix>;
53 } // namespace sot
54 } // namespace dynamicgraph
Eigen::VectorXd Vector
integrates an ODE using a naive Euler integration. TODO: change the integration method. For the moment, the highest derivative of the output signal is computed using the previous values of the other derivatives and the input signal, then integrated n times, which will most certainly induce a huge drift for ODEs with a high order at the denominator.
Eigen::MatrixXd Matrix
SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(IntegratorEuler, double, double, "IntegratorEulerDoubleDouble") SOT_FACTORY_TEMPLATE_ENTITY_PLUGIN_EULER(IntegratorEuler


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26