- 3.0.2 models module.
jsim.h
Go to the documentation of this file.
1 #ifndef IIT_CT_DOUBLEINVERTEDPENDULUM_JSIM_H_
2 #define IIT_CT_DOUBLEINVERTEDPENDULUM_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_DoubleInvertedPendulum {
16 namespace dyn {
17 
18 namespace tpl {
19 
23 template <typename TRAIT>
24 class JSIM : public iit::rbd::StateDependentMatrix<iit::ct_DoubleInvertedPendulum::tpl::JointState<typename TRAIT::Scalar>, 2, 2, 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_DoubleInvertedPendulum::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  InertiaMatrix Link1_Ic;
79  const InertiaMatrix& Link2_Ic;
80  InertiaMatrix Ic_spare;
81 
82  MatrixType L;
83  MatrixType Linv;
84  MatrixType inverse;
85 };
86 
87 template <typename TRAIT>
88 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getL() const {
89  return L;
90 }
91 
92 template <typename TRAIT>
93 inline const typename JSIM<TRAIT>::MatrixType& JSIM<TRAIT>::getInverse() const {
94  return inverse;
95 }
96 
97 
98 }
99 
101 
102 }
103 }
104 }
105 
106 #include "jsim.impl.h"
107 
108 #endif
JSIM(IProperties &, FTransforms &)
Definition: jsim.impl.h:5
void computeL()
Definition: jsim.impl.h:52
const JSIM & update(const JointState &)
Definition: jsim.impl.h:17
iit::rbd::tpl::InertiaMatrixDense< Scalar > InertiaMatrix
Definition: jsim.h:38
CoreS::ForceVector ForceVector
Definition: jsim.h:39
Column2d< SCALAR > JointState
Definition: declarations.h:19
iit::ct_DoubleInvertedPendulum::tpl::ForceTransforms< TRAIT > FTransforms
Definition: jsim.h:37
ct::core::ADCodegenLinearizer< state_dim, control_dim >::ADCGScalar Scalar
Definition: HyALinearizationCodeGen.cpp:23
iit::rbd::PlainMatrix< Scalar, 2, 2 > MatrixType
Definition: jsim.h:35
void computeLInverse()
Definition: jsim.impl.h:75
void computeInverse()
Definition: jsim.impl.h:65
iit::rbd::Core< Scalar > CoreS
Definition: jsim.h:33
Base::Index Index
Definition: jsim.h:34
const MatrixType & getL() const
Definition: jsim.h:88
Vector6D ForceVector
const MatrixType & getInverse() const
Definition: jsim.h:93
Eigen::Matrix< Scalar, R, C > PlainMatrix
iit::ct_DoubleInvertedPendulum::tpl::JointState< Scalar > JointState
Definition: jsim.h:32
TRAIT::Scalar Scalar
Definition: jsim.h:31
InertiaProperties< TRAIT > IProperties
Definition: jsim.h:36