4#include "BodyKinematics6Dof.h"
5#include "RigidBodyTerms.h"
7#include <fhsim/simobject/ISimObjectCreator.h>
8#include <fhsim_environment/WakeSourceSet.h>
11namespace environment::wake
13class BodyFlowInteraction;
58 double values[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
61 void Add(
const double wrench[6]);
92environment::wake::WakeCastState CastStateOf(
const FlowFrame& frame);
111 HydroBody(ISimObjectCreator* creator,
const std::string& angularRateName,
double convergenceTime, rigid_body::MunkMoment munk);
118 void SetInertia(
const double rigid[6],
const double added[6]);
176 rigid_body::MunkMoment m_munk;
177 double m_rigidInertia[6] = {};
178 double m_addedMass[6] = {};
179 double m_massInverse[6][6] = {};
Definition BodyKinematics6Dof.h:37
Definition HydroBody.h:101
const double * AddedMass() const
The diagonal of the added mass.
Definition HydroBody.h:127
hydro_body::FlowFrame LocalFrame(const environment::wake::BodyFlowInteraction &flow, double t, const double *localX) const
LocalFrame(localX, waterVel_n) with the water velocity of flow at the body origin at time t.
void AddJacobian(const double *localX, const hydro_body::FlowFrame &frame, double dWrench[6][6], double *J, int nStates) const
HydroBody(ISimObjectCreator *creator, const std::string &angularRateName, double convergenceTime, rigid_body::MunkMoment munk)
hydro_body::FlowFrame LocalFrame(const double *localX, const double waterVel_n[3]) const
void Derivatives(const hydro_body::FlowFrame &frame, const hydro_body::Wrench &wrench, const double *X, double *XDot) const
const BodyKinematics6Dof & Kinematics() const
The kinematic states and their indices.
Definition HydroBody.h:121
hydro_body::FlowFrame Frame(const environment::wake::BodyFlowInteraction &flow, double t, const double *X) const
Frame(X, waterVel_n) with the water velocity of flow at the body origin at time t (BodyFlowInteractio...
hydro_body::FlowFrame Frame(const double *X, const double waterVel_n[3]) const
const double * RigidInertia() const
The diagonal of the rigid-body inertia.
Definition HydroBody.h:124
void SetInertia(const double rigid[6], const double added[6])
double InverseMass(int i) const
The entry i of the diagonal of M^-1.
Definition HydroBody.h:130
Definition HydroBody.h:42
const double * omega
The angular-rate state, body frame [rad/s].
Definition HydroBody.h:46
double waterVel_n[3]
The water velocity at the body origin, NED [m/s].
Definition HydroBody.h:50
const double * vel_d
The velocity state, body frame [m/s].
Definition HydroBody.h:45
const double * quater
The attitude quaternion state [q0, q1, q2, q3].
Definition HydroBody.h:44
double waterVel_d[3]
The water velocity at the body origin, body frame [m/s].
Definition HydroBody.h:51
double R[3][3]
The body-to-NED rotation matrix.
Definition HydroBody.h:48
double relVel_d[3]
The velocity of the body relative to the water, vel_d - waterVel_d, body frame [m/s].
Definition HydroBody.h:52
double vel_n[3]
The velocity of the body origin, NED [m/s].
Definition HydroBody.h:49
const double * pos_n
The position state, NED [m].
Definition HydroBody.h:43
The sum of the loads on a body: the force [0..2] and the moment about the origin [3....
Definition HydroBody.h:57
void Add(const double wrench[6])
Adds the body-frame wrench wrench.
void AddWeightAndBuoyancy(const FlowFrame &frame, double mass, const double cog_d[3], const double buoyancy_n[3])
void AddForceAt(const FlowFrame &frame, const double pos_d[3], const double force_n[3])