- 3.0.2 models module.
jsim.h
Go to the documentation of this file.
1 #ifndef IIT_CT_HYA_JSIM_H_
2 #define IIT_CT_HYA_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 ct_HyA {
16 namespace dyn {
17 
18 namespace tpl{
19 
23 template <class TRAIT>
24 class JSIM : public iit::rbd::StateDependentMatrix<iit::ct_HyA::tpl::JointState<typename TRAIT::Scalar>, 6, 6, JSIM<TRAIT>>
25 {
26  public:
27  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28  private:
30  public:
31  typedef typename TRAIT::Scalar SCALAR;
32  typedef typename Base::Index Index;
33  typedef Eigen::Matrix<SCALAR,6,6> MatrixType;
35  typedef iit::ct_HyA::tpl::ForceTransforms<TRAIT> FTransforms;
39 
40  public:
41  JSIM(IProperties&, FTransforms&);
42  ~JSIM() {}
43 
44  const JSIM& update(const JointState&);
45 
46 
50  void computeL();
57  void computeInverse();
61  const MatrixType& getL() const;
65  const MatrixType& getInverse() const;
66 
67  protected:
71  void computeLInverse();
72  private:
73  IProperties& linkInertias;
74  FTransforms* frcTransf;
75 
76  // The composite-inertia tensor for each link
77  InertiaMatrix Shoulder_AA_Ic;
78  InertiaMatrix Shoulder_FE_Ic;
79  InertiaMatrix Humerus_R_Ic;
80  InertiaMatrix Elbow_FE_Ic;
81  InertiaMatrix Wrist_R_Ic;
82  const InertiaMatrix& Wrist_FE_Ic;
83  InertiaMatrix Ic_spare;
84 
85  MatrixType L;
86  MatrixType Linv;
87  MatrixType inverse;
88 };
89 
90 template <class TRAIT>
91 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getL() const {
92  return L;
93 }
94 
95 template <class TRAIT>
96 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getInverse() const {
97  return inverse;
98 }
99 
100 
101 } // namespace tpl
102 
104 
105 }
106 }
107 }
108 
109 #include "jsim.impl.h"
110 
111 #endif
Definition: derivativeIvState.hpp:21
iit::ct_HyA::tpl::ForceTransforms< TRAIT > FTransforms
Definition: jsim.h:35
void computeLInverse()
Definition: jsim.impl.h:249
void computeInverse()
Definition: jsim.impl.h:207
Definition: jsim.h:24
~JSIM()
Definition: jsim.h:42
ct::core::ADCodegenLinearizer< state_dim, control_dim >::ADCGScalar Scalar
Definition: HyALinearizationCodeGen.cpp:23
const JSIM & update(const JointState &)
Definition: jsim.impl.h:17
JSIM(IProperties &, FTransforms &)
Definition: jsim.impl.h:5
Base::Index Index
Definition: jsim.h:32
const MatrixType & getL() const
Definition: jsim.h:91
InertiaProperties< TRAIT > IProperties
Definition: jsim.h:34
iit::ct_HyA::tpl::JointState< SCALAR > JointState
Definition: jsim.h:37
Eigen::Matrix< SCALAR, 6, 6 > MatrixType
Definition: jsim.h:33
Vector6D ForceVector
void computeL()
Definition: jsim.impl.h:134
iit::rbd::tpl::InertiaMatrixDense< SCALAR > InertiaMatrix
Definition: jsim.h:36
TRAIT::Scalar SCALAR
Definition: jsim.h:31
const MatrixType & getInverse() const
Definition: jsim.h:96
iit::rbd::Core< SCALAR >::ForceVector ForceVector
Definition: jsim.h:38
Definition: inertia_properties.h:26
Column6d< SCALAR > JointState
Definition: declarations.h:20