- 3.0.2 rigid body dynamics module.
jsim.h
Go to the documentation of this file.
1 #ifndef IIT_TESTHYQ_JSIM_H_
2 #define IIT_TESTHYQ_JSIM_H_
3 
4 #include <iit/rbd/rbd.h>
6 
7 #include "declarations.h"
8 #include "transforms.h"
9 #include "inertia_properties.h"
12 
13 
14 namespace iit {
15 namespace TestHyQ {
16 namespace dyn {
17 
18 namespace tpl {
19 
23 template <typename TRAIT>
24 class JSIM : public iit::rbd::StateDependentMatrix<iit::TestHyQ::tpl::JointState<typename TRAIT::Scalar>, 18, 18, JSIM<TRAIT>>
25 {
26  public:
27  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28  private:
30  public:
31  typedef typename TRAIT::Scalar Scalar;
34  typedef typename Base::Index Index;
37  typedef const Eigen::Block<const MatrixType,6,12> BlockF_t;
39  typedef const Eigen::Block<const MatrixType,12,12> BlockFixedBase_t;
41  typedef iit::TestHyQ::tpl::ForceTransforms<TRAIT> FTransforms;
43 
44  public:
45  JSIM(IProperties&, FTransforms&);
46  ~JSIM() {}
47 
48  const JSIM& update(const JointState&);
49 
50 
54  void computeL();
61  void computeInverse();
65  const MatrixType& getL() const;
69  const MatrixType& getInverse() const;
70 
81  const InertiaMatrix& getWholeBodyInertia() const;
88  const BlockF_t getF() const;
96  const BlockFixedBase_t getFixedBaseBlock() const;
97  protected:
101  void computeLInverse();
102  private:
103  IProperties& linkInertias;
104  FTransforms* frcTransf;
105 
106  // The composite-inertia tensor for each link
107  InertiaMatrix trunk_Ic;
108  InertiaMatrix LF_hipassembly_Ic;
109  InertiaMatrix LF_upperleg_Ic;
110  const InertiaMatrix& LF_lowerleg_Ic;
111  InertiaMatrix RF_hipassembly_Ic;
112  InertiaMatrix RF_upperleg_Ic;
113  const InertiaMatrix& RF_lowerleg_Ic;
114  InertiaMatrix LH_hipassembly_Ic;
115  InertiaMatrix LH_upperleg_Ic;
116  const InertiaMatrix& LH_lowerleg_Ic;
117  InertiaMatrix RH_hipassembly_Ic;
118  InertiaMatrix RH_upperleg_Ic;
119  const InertiaMatrix& RH_lowerleg_Ic;
120  InertiaMatrix Ic_spare;
121 
122  MatrixType L;
123  MatrixType Linv;
124  MatrixType inverse;
125 };
126 
127 template <typename TRAIT>
128 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getL() const {
129  return L;
130 }
131 
132 template <typename TRAIT>
133 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getInverse() const {
134  return inverse;
135 }
136 
137 template <typename TRAIT>
139  return trunk_Ic;
140 }
141 
142 template <typename TRAIT>
143 inline const typename JSIM<TRAIT>::BlockF_t JSIM<TRAIT>::getF() const {
144  return JSIM<TRAIT>:: template block<6,12>(0,6);
145 }
146 
147 template <typename TRAIT>
149  return JSIM<TRAIT>:: template block<12,12>(6,6);
150 }
151 
152 }
153 
155 
156 }
157 }
158 }
159 
160 #include "jsim.impl.h"
161 
162 #endif
const BlockFixedBase_t getFixedBaseBlock() const
Definition: jsim.h:148
iit::rbd::tpl::InertiaMatrixDense< Scalar > InertiaMatrix
Definition: jsim.h:42
Definition: StateDependentMatrix.h:36
const MatrixType & getInverse() const
Definition: jsim.h:133
iit::TestHyQ::tpl::JointState< Scalar > JointState
Definition: jsim.h:32
iit::rbd::PlainMatrix< Scalar, 18, 18 > MatrixType
Definition: jsim.h:35
~JSIM()
Definition: jsim.h:46
const BlockF_t getF() const
Definition: jsim.h:143
JSIM(IProperties &, FTransforms &)
Definition: jsim.impl.h:5
TRAIT::Scalar Scalar
Definition: jsim.h:31
InertiaProperties< TRAIT > IProperties
Definition: jsim.h:40
void computeLInverse()
Definition: jsim.impl.h:317
Base::Index Index
Definition: StateDependentMatrix.h:47
const Eigen::Block< const MatrixType, 6, 12 > BlockF_t
Definition: jsim.h:37
void computeL()
Definition: jsim.impl.h:206
iit::rbd::Core< Scalar > CoreS
Definition: jsim.h:33
Definition: inertia_properties.h:24
Definition: rbd.h:72
Column12d< SCALAR > JointState
Definition: declarations.h:19
const MatrixType & getL() const
Definition: jsim.h:128
const InertiaMatrix & getWholeBodyInertia() const
Definition: jsim.h:138
const JSIM & update(const JointState &)
Definition: jsim.impl.h:22
Base::Index Index
Definition: jsim.h:34
Eigen::Matrix< Scalar, R, C > PlainMatrix
Definition: rbd.h:54
Definition: jsim.h:24
void computeInverse()
Definition: jsim.impl.h:275
const Eigen::Block< const MatrixType, 12, 12 > BlockFixedBase_t
Definition: jsim.h:39
iit::TestHyQ::tpl::ForceTransforms< TRAIT > FTransforms
Definition: jsim.h:41