113#include <fhsim/simobject/SimObject.h>
114#include <fhsim_environment/BodyFlowInteraction.h>
115#include <fhsim_environment/EnvironmentProvider.h>
116#include <fhsim_environment/SeafloorForcesInterface.h>
117#include <fhsim_environment/hydrodynamics/SphereHydro.h>
123 CenterWeight(std::string simObjectName, ISimObjectCreator* creator);
126 virtual void OdeFcn(
const double dT,
const double*
const adX,
127 double*
const adXDot)
const;
136 bool HasJacobians()
const override;
137 void OdeJacobian(
double T,
const double* X,
double* J,
int nStates)
override;
138 int GetJacobianSparsity(
int nStates,
int* rowPtr,
int* colIdx)
override;
139 bool HasPortJacobians()
const override;
140 void InputPortJacobian(
const std::string& portName,
double T,
const double* X,
141 double* dF_dInput,
int portSize,
int nStates)
override;
143#ifdef FH_VISUALIZATION
145 void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
147 void RenderUpdate(
const double T,
const double*
const X);
149 void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
152 virtual const double* Position(
const double dT,
const double*
const adX);
153 virtual const double* Velocity(
const double dT,
const double*
const adX);
167 double m_visualizationScale;
173 std::optional<environment::sphere_hydro::SphereCaster>
m_caster;
174 environment::wake::BodyFlowInteraction
m_flow;
176 environment::SeafloorForcesInterface* m_seafloor;
179#ifdef FH_VISUALIZATION
180 std::string m_material;
181 std::string m_meshName;
183 Ogre::Entity* m_renderEntity;
184 Ogre::SceneNode* m_renderNode;
185 Ogre::SceneManager* m_sceneMgr;
Definition CenterWeight.h:121
std::optional< environment::sphere_hydro::SphereCaster > m_caster
The sphere on its states, for the wake.
Definition CenterWeight.h:173
double m_rhoWater
The water density Rho [kg/m^3].
Definition CenterWeight.h:170
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:163
void waterVelocity(double T, const double *X, double velocity[3]) const
The water velocity at the weight: the BodyFlowInteraction's, without the weight's own wake.
ISignalPort * m_inForce2
A pointer to the input force 2.
Definition CenterWeight.h:160
void PreOdeFcn(double T, const double *X) override
Rebuilds the weight's wake when due and takes the other objects' wakes at the weight.
environment::wake::BodyFlowInteraction m_flow
The wake the weight casts and receives.
Definition CenterWeight.h:174
bool m_inBottomContact
Whether the seafloor force was non-zero at the last OdeFcn state.
Definition CenterWeight.h:177
int m_IStatePos
The index of the position state.
Definition CenterWeight.h:162
ISignalPort * m_inForce3
A pointer to the input force 3.
Definition CenterWeight.h:161
environment::sphere_hydro::Sphere m_sphere
ρ, D = 2 r and C_d of the drag.
Definition CenterWeight.h:172
ISignalPort * m_inForce1
A pointer to the input force 1.
Definition CenterWeight.h:159