FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
CenterWeight.h
1#pragma once
2
96#include <fhsim/simobject/SimObject.h>
97#include <fhsim_environment/EnvironmentProvider.h>
98#include <fhsim_environment/SeafloorForcesInterface.h>
99
100class CenterWeight : public SimObject
101{
102public:
103 CenterWeight(std::string simObjectName, ISimObjectCreator* creator);
104
106 virtual void OdeFcn(const double dT, const double* const adX,
107 double* const adXDot) const;
108
114 bool HasJacobians() const override;
115 void OdeJacobian(double T, const double* X, double* J, int nStates) override;
116 int GetJacobianSparsity(int nStates, int* rowPtr, int* colIdx) override;
117 bool HasPortJacobians() const override;
118 void InputPortJacobian(const std::string& portName, double T, const double* X,
119 double* dF_dInput, int portSize, int nStates) override;
121#ifdef FH_VISUALIZATION
123 void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
125 void RenderUpdate(const double T, const double* const X);
126#endif
127 void FinalSetup(const double dT, const double* const adX, ISimObjectCreator* const creator);
128 virtual const double* Position(const double dT, const double* const adX);
129 virtual const double* Velocity(const double dT, const double* const adX);
130
131protected:
132 ISignalPort* m_inForce1;
133 ISignalPort* m_inForce2;
134 ISignalPort* m_inForce3;
137
138 double m_mass;
139 double m_density;
140 double m_visualizationScale;
141 double m_radius;
142 double m_weight;
143
144 environment::EnvironmentProvider* m_environment;
145 environment::SeafloorForcesInterface* m_seafloor;
146
147#ifdef FH_VISUALIZATION
148 std::string m_material;
149 std::string m_meshName;
150 double m_scale;
151 Ogre::Entity* m_renderEntity;
152 Ogre::SceneNode* m_renderNode;
153 Ogre::SceneManager* m_sceneMgr;
154#endif
155};
Definition CenterWeight.h:101
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot) const
Calculates the state derivatives.
int m_IStateVel
The index of the velocity state.
Definition CenterWeight.h:136
ISignalPort * m_inForce2
A pointer to the input force 2.
Definition CenterWeight.h:133
int m_IStatePos
The index of the position state.
Definition CenterWeight.h:135
ISignalPort * m_inForce3
A pointer to the input force 3.
Definition CenterWeight.h:134
ISignalPort * m_inForce1
A pointer to the input force 1.
Definition CenterWeight.h:132