mass-apparent.h 3.23 KB
Newer Older
Thomas Moulard's avatar
Thomas Moulard committed
1
2
3
4
/*
 * Copyright 2010,
 * François Bleibel,
 * Olivier Stasse,
Francois Bleibel's avatar
Francois Bleibel committed
5
 *
Thomas Moulard's avatar
Thomas Moulard committed
6
 * CNRS/AIST
Francois Bleibel's avatar
Francois Bleibel committed
7
 *
8
9
 * This file is part of sot-dynamic-pinocchio.
 * sot-dynamic-pinocchio is free software: you can redistribute it and/or
Thomas Moulard's avatar
Thomas Moulard committed
10
11
12
 * modify it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
13
 * sot-dynamic-pinocchio is distributed in the hope that it will be
Thomas Moulard's avatar
Thomas Moulard committed
14
15
16
17
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.  You should
 * have received a copy of the GNU Lesser General Public License along
18
 * with sot-dynamic-pinocchio.  If not, see <http://www.gnu.org/licenses/>.
Thomas Moulard's avatar
Thomas Moulard committed
19
 */
Francois Bleibel's avatar
Francois Bleibel committed
20
21
22
23
24
25
26
27
28

#ifndef __SOT_SOTMASSAPPARENT_H__
#define __SOT_SOTMASSAPPARENT_H__

/* --------------------------------------------------------------------- */
/* --- INCLUDE --------------------------------------------------------- */
/* --------------------------------------------------------------------- */

/* Matrix */
29
30
#include <dynamic-graph/linear-algebra.h>

Francois Bleibel's avatar
Francois Bleibel committed
31
32
33
34
35

/* SOT */
#include <dynamic-graph/entity.h>
#include <dynamic-graph/signal-ptr.h>
#include <dynamic-graph/signal-time-dependent.h>
36
37
#include <sot/core/matrix-geometry.hh>

Francois Bleibel's avatar
Francois Bleibel committed
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

/* STD */
#include <string>

/* --------------------------------------------------------------------- */
/* --- API ------------------------------------------------------------- */
/* --------------------------------------------------------------------- */

#if defined (WIN32) 
#  if defined (mass_apparent_EXPORTS)
#    define SOTMASSAPPARENT_EXPORT __declspec(dllexport)
#  else  
#    define SOTMASSAPPARENT_EXPORT __declspec(dllimport)
#  endif 
#else
#  define SOTMASSAPPARENT_EXPORT
#endif


57
58
namespace dynamicgraph { namespace sot {
    namespace dg = dynamicgraph;
Francois Bleibel's avatar
Francois Bleibel committed
59

60
61
62
63
64
65
66
67
    /* --------------------------------------------------------------------- */
    /* --- CLASS ----------------------------------------------------------- */
    /* --------------------------------------------------------------------- */
    class SOTMASSAPPARENT_EXPORT MassApparent
      :public dg::Entity
      {
      public:
	static const std::string CLASS_NAME;
68
	virtual const std::string& getClassName( void ) const { return CLASS_NAME; }
Francois Bleibel's avatar
Francois Bleibel committed
69

70
      public: /* --- CONSTRUCTION --- */
Francois Bleibel's avatar
Francois Bleibel committed
71

72
73
	MassApparent( const std::string& name );
	virtual ~MassApparent( void );
Francois Bleibel's avatar
Francois Bleibel committed
74

75
      public: /* --- SIGNAL --- */
Francois Bleibel's avatar
Francois Bleibel committed
76

77
78
79
80
	dg::SignalPtr<dynamicgraph::Matrix,int> jacobianSIN; 
	dg::SignalPtr<dynamicgraph::Matrix,int> inertiaInverseSIN; 
	dg::SignalTimeDependent<dynamicgraph::Matrix,int> massInverseSOUT; 
	dg::SignalTimeDependent<dynamicgraph::Matrix,int> massSOUT; 
Francois Bleibel's avatar
Francois Bleibel committed
81

82
83
	dg::SignalPtr<dynamicgraph::Matrix,int> inertiaSIN; 
	dg::SignalTimeDependent<dynamicgraph::Matrix,int> inertiaInverseSOUT; 
Francois Bleibel's avatar
Francois Bleibel committed
84

85
      public: /* --- FUNCTIONS --- */
86
87
88
	dynamicgraph::Matrix& computeMassInverse( dynamicgraph::Matrix& res,const int& time );
	dynamicgraph::Matrix& computeMass( dynamicgraph::Matrix& res,const int& time );
	dynamicgraph::Matrix& computeInertiaInverse( dynamicgraph::Matrix& res,const int& time );
89
      };
Francois Bleibel's avatar
Francois Bleibel committed
90
91


92
93
  } // namespace sot
} // namespace dynamicgraph
Francois Bleibel's avatar
Francois Bleibel committed
94
95
96

#endif // #ifndef __SOT_SOTMASSAPPARENT_H__