- 3.0.2 models module.
jsim.h
Go to the documentation of this file.
1 #ifndef IIT_CT_INVERTEDPENDULUM_JSIM_H_
2 #define IIT_CT_INVERTEDPENDULUM_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_InvertedPendulum {
16 namespace dyn {
17 
18 namespace tpl {
19 
23 template <typename TRAIT>
24 class JSIM : public iit::rbd::StateDependentMatrix<iit::ct_InvertedPendulum::tpl::JointState<typename TRAIT::Scalar>, 1, 1, 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 iit::ct_InvertedPendulum::tpl::ForceTransforms<TRAIT> FTransforms;
39  typedef typename CoreS::ForceVector ForceVector;
40 
41  public:
42  JSIM(IProperties&, FTransforms&);
43  ~JSIM() {}
44 
45  const JSIM& update(const JointState&);
46 
47 
51  void computeL();
58  void computeInverse();
62  const MatrixType& getL() const;
66  const MatrixType& getInverse() const;
67 
68  protected:
72  void computeLInverse();
73  private:
74  IProperties& linkInertias;
75  FTransforms* frcTransf;
76 
77  // The composite-inertia tensor for each link
78  const InertiaMatrix& Link1_Ic;
79  InertiaMatrix Ic_spare;
80 
81  MatrixType L;
82  MatrixType Linv;
83  MatrixType inverse;
84 };
85 
86 template <typename TRAIT>
87 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getL() const {
88  return L;
89 }
90 
91 template <typename TRAIT>
92 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getInverse() const {
93  return inverse;
94 }
95 
96 
97 }
98 
100 
101 }
102 }
103 }
104 
105 #include "jsim.impl.h"
106 
107 #endif
TRAIT::Scalar Scalar
Definition: jsim.h:31
InertiaProperties< TRAIT > IProperties
Definition: jsim.h:36
CoreS::ForceVector ForceVector
Definition: jsim.h:39
iit::rbd::tpl::InertiaMatrixDense< Scalar > InertiaMatrix
Definition: jsim.h:38
iit::rbd::PlainMatrix< Scalar, 1, 1 > MatrixType
Definition: jsim.h:35
void computeLInverse()
Definition: jsim.impl.h:54
ct::core::ADCodegenLinearizer< state_dim, control_dim >::ADCGScalar Scalar
Definition: HyALinearizationCodeGen.cpp:23
void computeL()
Definition: jsim.impl.h:39
Column1d< SCALAR > JointState
Definition: declarations.h:19
Base::Index Index
Definition: jsim.h:34
const MatrixType & getL() const
Definition: jsim.h:87
iit::ct_InvertedPendulum::tpl::ForceTransforms< TRAIT > FTransforms
Definition: jsim.h:37
JSIM(IProperties &, FTransforms &)
Definition: jsim.impl.h:5
Vector6D ForceVector
const MatrixType & getInverse() const
Definition: jsim.h:92
void computeInverse()
Definition: jsim.impl.h:47
iit::rbd::Core< Scalar > CoreS
Definition: jsim.h:33
Eigen::Matrix< Scalar, R, C > PlainMatrix
const JSIM & update(const JointState &)
Definition: jsim.impl.h:17
iit::ct_InvertedPendulum::tpl::JointState< Scalar > JointState
Definition: jsim.h:32