FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
BodyKinematics6Dof.h
1#ifndef BODY_KINEMATICS_6DOF_H
2#define BODY_KINEMATICS_6DOF_H
3
4#include <fhsim/simobject/ISimObjectCreator.h>
5#include <string>
6
37{
38 public:
45 BodyKinematics6Dof(ISimObjectCreator* creator, const std::string& angularRateName, double convergenceTime);
46
48 int PosIndex() const { return m_posIndex; }
49
51 int QuaterIndex() const { return m_quaterIndex; }
52
54 int LocalVelIndex() const { return m_localVelIndex; }
55
57 int AngularRateIndex() const { return m_angularRateIndex; }
58
60 int LocalIndex(int globalIndex) const { return globalIndex - m_posIndex; }
61
68 void Derivatives(const double* X, double posDot[3], double quaterDot[4]) const;
69
76 void AddJacobian(const double* localX, double* J, int nStates) const;
77
83 static void RotationDerivatives(const double quater[4], double dRdq[4][9]);
84
85 private:
86 void AddPositionJacobian(const double* localX, double* J, int nStates) const;
87 void AddQuaternionJacobian(const double* localX, double* J, int nStates) const;
88
89 int m_posIndex = 0;
90 int m_quaterIndex = 0;
91 int m_localVelIndex = 0;
92 int m_angularRateIndex = 0;
93 double m_convergenceTime = 0.0;
94};
95
96#endif
Definition BodyKinematics6Dof.h:37
int LocalIndex(int globalIndex) const
Index within the object's state slice of the state with global index globalIndex.
Definition BodyKinematics6Dof.h:60
void Derivatives(const double *X, double posDot[3], double quaterDot[4]) const
int AngularRateIndex() const
Global index of the body-frame angular-rate state.
Definition BodyKinematics6Dof.h:57
BodyKinematics6Dof(ISimObjectCreator *creator, const std::string &angularRateName, double convergenceTime)
int QuaterIndex() const
Global index of the attitude quaternion state.
Definition BodyKinematics6Dof.h:51
int PosIndex() const
Global index of the position state.
Definition BodyKinematics6Dof.h:48
void AddJacobian(const double *localX, double *J, int nStates) const
static void RotationDerivatives(const double quater[4], double dRdq[4][9])
int LocalVelIndex() const
Global index of the body-frame velocity state.
Definition BodyKinematics6Dof.h:54