matrix-inertia.h
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_SOTMATRIXINERTIA_H__
11 #define __SOT_SOTMATRIXINERTIA_H__
12 
13 #include <ostream>
14 #include <sot/core/matrix-geometry.hh>
15 
16 #include "dynamic-graph/linear-algebra.h"
17 
18 /* --------------------------------------------------------------------- */
19 /* --- API ------------------------------------------------------------- */
20 /* --------------------------------------------------------------------- */
21 
22 #if defined(WIN32)
23 #if defined(matrix_inertia_EXPORTS)
24 #define SOTMATRIXINERTIA_EXPORT __declspec(dllexport)
25 #else
26 #define SOTMATRIXINERTIA_EXPORT __declspec(dllimport)
27 #endif
28 #else
29 #define SOTMATRIXINERTIA_EXPORT
30 #endif
31 
32 namespace dynamicgraph {
33 namespace sot {
34 namespace dg = dynamicgraph;
35 
36 /* -------------------------------------------------------------------------- */
37 /* -------------------------------------------------------------------------- */
38 /* -------------------------------------------------------------------------- */
40  public:
41  private:
42  MatrixInertia(void) {}
43 
44  void initParents(void);
45  void initDofTable(void);
46 
47  public:
48  MatrixInertia(CjrlHumanoidDynamicRobot* aHDR);
50  void init(CjrlHumanoidDynamicRobot* aHDR);
51 
52  public:
53  void update(void);
55  void getInertiaMatrix(double* A);
56  const maal::boost::Matrix& getInertiaMatrix(void);
57  size_t getDoF() { return joints_.size(); }
58 
59  private:
60  CjrlHumanoidDynamicRobot* aHDR_;
61  dynamicsJRLJapan::HumanoidDynamicMultiBody* aHDMB_;
62  std::vector<CjrlJoint*> joints_;
63  std::vector<int> parentIndex_;
64 
65  std::vector<dynamicgraph::Matrix> Ic;
66  std::vector<dynamicgraph::Vector> phi;
67  std::vector<MatrixTwist> iVpi;
68  std::vector<MatrixForce> iVpiT;
69  dynamicgraph::Matrix inertia_;
70 };
71 
72 } /* namespace sot */
73 } /* namespace dynamicgraph */
74 
75 #endif // __SOT_SOTMATRIXINERTIA_H__
Definition: matrix-inertia.h:39
size_t getDoF()
Definition: matrix-inertia.h:57
void init(CjrlHumanoidDynamicRobot *aHDR)
const maal::boost::Matrix & getInertiaMatrix(void)
MatrixInertia(CjrlHumanoidDynamicRobot *aHDR)
#define SOTMATRIXINERTIA_EXPORT
Definition: matrix-inertia.h:29
Definition: angle-estimator.h:43