Marine systems simulation
LocalConnection.h
1#ifndef LocalConnection_h__
2#define LocalConnection_h__
3
54#include <ISimObjectCreator.h>
55#include <Eigen/Eigen>
56
57#ifdef FH_VISUALIZATION
58 #include "sfh/ogre/C3DArrow.h"
59#endif
60
61
62class CFhSimMgr;
63
64namespace Ship{
65 class LocalConnection: public SimObject
66 {
67 public:
68 LocalConnection( const string simObjectName, ISimObjectCreator* const creator);
70 virtual void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
71 virtual void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
72 #ifdef FH_VISUALIZATION
73 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
74 virtual void RenderUpdate( const double T, const double* const X );
75 #endif
76 public:
77
79 const double * OffsetBody(const double T, const double * const X);
81 const double * RotationBody(const double T, const double * const X);
82
84 const double * PositionNED(const double T, const double * const X);
86 const double * VelocityNED(const double T, const double * const X);
88 const double * VelocityBody(const double T, const double * const X);
90 const double * OmegaNED(const double T, const double * const X);
93 const double * QuaternionNED(const double T, const double * const X);
95 const double * Axis1NED(const double T, const double * const X);
97 const double * Axis2NED(const double T, const double * const X);
99 const double * Axis3NED(const double T, const double * const X);
102 const double * ForceNED(const double T, const double * const X);
104 const double * TorqueNED(const double T, const double * const X);
106 const double * ForceBody(const double T, const double * const X);
108 const double * TorqueBody(const double T, const double * const X);
110 const double * ParentQuaterion(const double T, const double * const X);
111
112 protected:
113
114 const double * Force(const double T, const double * const X);
116 const double * Torque(const double T, const double * const X);
117
118 double m_positionNED[3];
119 double m_omegaNED[3];
120 double m_velocityNED[3];
121 double m_omegaBody[3];
122 double m_velocityBody[3];
123 double m_quaternionNED[4];
124
125 double m_axis1NED[3];
126 double m_axis2NED[3];
127 double m_axis3NED[3];
128
129 double m_ForceNED[3];
130 double m_TorqueNED[3];
131
132 double m_ForceBody[3];
133 double m_TorqueBody[3];
134
135 bool m_isAzimuth;
136 double m_azimuthLoss[2];
137
138
146 ISignalPort *m_InParentOmegaNED;
148 ISignalPort *m_InForce;
150 ISignalPort *m_InMotorAngularTarget[3];
152 ISignalPort *m_InMotorLinearTarget[3];
154 double m_Offset[3];
159
161 ISignalPort *m_InOffset;
164 ISignalPort *m_InPositionCGNED;
165
166 bool m_isLinearMotor;
167 bool m_isAngularMotor;
168 int m_stateLinearMotor[3];
169 int m_stateAngularMotor[3];
170
171 double m_linearMotorMaxChangerate[3];
172 double m_angularMotorMaxChangerate[3];
173 double m_linearMotorConstants[3];
174 double m_angularMotorConstants[3];
175
176 double m_linearStaticOffset[3];
177 double m_angularStaticOffset[3];
178
179 double m_linearForceAttackOffset[3];
180
181 ICommonComputation *m_computePosition, *m_computeForce;
182 void ComputePostition( const double T, const double * const X);
183 void ComputeForce( const double T, const double * const X);
184
185#ifdef FH_VISUALIZATION
187 bool m_DrawConnection;
188 Ogre::Entity* m_RenderEntity;
189 Ogre::SceneNode* m_RenderNode;
190 C3DArrow *m_ForceArrow;
191
192 #endif
193 };
194}
195#endif // LocalConnection_h__
Definition: LocalConnection.h:66
const double * Axis2NED(const double T, const double *const X)
double m_Offset[3]
Definition: LocalConnection.h:154
const double * ForceNED(const double T, const double *const X)
ISignalPort * m_InOffset
Definition: LocalConnection.h:161
const double * OffsetBody(const double T, const double *const X)
const double * Axis3NED(const double T, const double *const X)
const double * TorqueNED(const double T, const double *const X)
const double * Torque(const double T, const double *const X)
ISignalPort * m_InParentOmegaNED
Definition: LocalConnection.h:146
ISignalPort * m_InParentVelocityNED
Definition: LocalConnection.h:144
ISignalPort * m_InPositionCGNED
Definition: LocalConnection.h:164
const double * TorqueBody(const double T, const double *const X)
ISignalPort * m_InMotorAngularTarget[3]
Definition: LocalConnection.h:150
const double * QuaternionNED(const double T, const double *const X)
bool m_ForceInBodyFrame
Definition: LocalConnection.h:158
const double * OmegaNED(const double T, const double *const X)
ISignalPort * m_InMotorLinearTarget[3]
Definition: LocalConnection.h:152
const double * RotationBody(const double T, const double *const X)
ISignalPort * m_InForce
Definition: LocalConnection.h:148
const double * ForceBody(const double T, const double *const X)
const double * Axis1NED(const double T, const double *const X)
const double * PositionNED(const double T, const double *const X)
ISignalPort * m_InParentQuaternionNED
Definition: LocalConnection.h:142
bool m_ForceCalculator
Definition: LocalConnection.h:156
const double * VelocityNED(const double T, const double *const X)
ISignalPort * m_InParentPositionNED
Definition: LocalConnection.h:140
const double * VelocityBody(const double T, const double *const X)
const double * ParentQuaterion(const double T, const double *const X)
Simple waypoint object.
Definition: CableAttach.h:16