Marine systems simulation
CSimpleRope.h
1
10
11#ifndef SimpleRope_H
12#define SimpleRope_H
13
14#include "SimObject.h"
15#include <Eigen/Eigen>
16#include "sfh/constants.h"
17
18#ifdef FH_VISUALIZATION
19#include "sfh/ogre/C3DLine.h"
20#endif
21
22namespace System {
23
24class SimpleRope : public SimObject
25{
26public:
27 typedef Eigen::Matrix<double, 3, 1> dvec3;
28
30 SimpleRope(std::string sSimObjectName, ISimObjectCreator* pCreator);
32
34 void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
35
36 void InitialConditionSetup(const double T, const double* const X, double* const XDot, ISimObjectCreator* pCreator);
37
38 const double * OutForceA(const double T, const double * const X);
39 const double * OutForceB(const double T, const double * const X);
40
41 void distance_constraint(dvec3& PA, dvec3& PB, dvec3& VA, dvec3& VB, dvec3& F, double L);
42
43#ifdef FH_VISUALIZATION
44 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
45 void RenderUpdate(const double T, const double* const X);
46#endif
47protected:
48 ISignalPort* m_InPosA;
49 ISignalPort* m_InPosB;
50 ISignalPort* m_InVelA;
51 ISignalPort* m_InVelB;
52 double m_E;
53 double m_D;
54 double m_L;
55 double m_K;
56 double m_Damp;
57
58 Eigen::Matrix<double, 3, 1> m_PosA;
59 Eigen::Matrix<double, 3, 1> m_PosB;
60 Eigen::Matrix<double, 3, 1> m_ForceA;
61 Eigen::Matrix<double, 3, 1> m_ForceB;
62
63 double m_DeltaT;
64 double m_Tau;
65 double m_Gamma;
66
67 dvec3 m_PreF;
68 double m_DeltaFMax;
69
70#ifdef FH_VISUALIZATION
71 C3DLine * m_Line;
72#endif
73};
74
75}
76#endif
Definition: CSimpleRope.h:25
void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
Calculates the state derivatives.
SimpleRope(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.
Class modelling a flexible bottom ring, inheriting from CRing in RMCable lib.
Definition: CCable.h:142