1 #ifndef CONTROLS_DYNAMICS_SYSTEM_DYNAMICS_BASE_H
2 #define CONTROLS_DYNAMICS_SYSTEM_DYNAMICS_BASE_H
44 double buoyancy_ = NAN;
47 Matrix3d Irb_ = Matrix3d::Zero();
65 Vector3d rgb_ = Vector3d::Zero();
68 Vector3d rbb_ = Vector3d::Zero();
71 Vector3d fgn_ = Vector3d::Zero();
74 Vector3d fbn_ = Vector3d::Zero();
230 const Quaterniond& orientation)
const;
257 void setI(
const std::array<double, 6>& I);
264 void setMa(
const std::array<double, 6>& m);
271 void setDl(
const std::array<double, 6>& d);
278 void setDnl(
const std::array<double, 6>& d);
285 void setRbb(
const std::array<double, 3>& rbb);
292 void setRgb(
const std::array<double, 3>& rgb);
Eigen::Matrix< double, 6, 6 > Matrix6d
Definition: Types.h:20
Eigen::Matrix< double, 6, 1 > Vector6d
Definition: Types.h:29
Base class encoding the 6DOF hydrodynamic model of a marine vehicle.
Definition: SystemDynamicsBase.h:20
void setMass(double m)
Sets vehicle mass and recomputes weight, buoyancy, and the rigid-body mass matrix.
Definition: SystemDynamicsBase.cpp:68
Matrix6d getCrb(const Vector6d &velocity) const
Evaluates the rigid-body Coriolis matrix Crb(v)
Definition: SystemDynamicsBase.cpp:37
void setDnl(const std::array< double, 6 > &d)
Sets the diagonal quadratic (nonlinear) damping coefficients.
Definition: SystemDynamicsBase.cpp:116
double getBuoyancyValue() const
Returns the net buoyancy force in N.
Definition: SystemDynamicsBase.h:154
const Vector3d & getRgbVec() const
Returns the centre of gravity in the body frame.
Definition: SystemDynamicsBase.h:124
void setRgb(const std::array< double, 3 > &rgb)
Sets the centre-of-gravity position in the body frame.
Definition: SystemDynamicsBase.cpp:130
void setDl(const std::array< double, 6 > &d)
Sets the diagonal linear damping coefficients.
Definition: SystemDynamicsBase.cpp:109
Matrix6d getCa(const Vector6d &velocity) const
Evaluates the added-mass Coriolis matrix Ca(v)
Definition: SystemDynamicsBase.cpp:41
virtual Vector6d getInverseDynamics(const Vector6d &velocity, const Vector6d &acceleration, const Quaterniond &orientation) const
Computes the inertial + Coriolis + damping force M*a + C(v)*v + D(v)*v.
Definition: SystemDynamicsBase.cpp:63
virtual ~SystemDynamicsBase()=default
Virtual destructor.
const Vector3d & getRbbVec() const
Returns the centre of buoyancy in the body frame.
Definition: SystemDynamicsBase.h:129
const Matrix6d & getDnlMatrix() const
Returns the quadratic damping matrix Dnl.
Definition: SystemDynamicsBase.h:119
const Matrix6d & getM() const
Returns the total mass matrix M = Mrb + Ma.
Definition: SystemDynamicsBase.h:99
const Matrix6d & getDlMatrix() const
Returns the linear damping matrix Dl.
Definition: SystemDynamicsBase.h:114
void setMa(const std::array< double, 6 > &m)
Sets the diagonal added-mass coefficients.
Definition: SystemDynamicsBase.cpp:101
SystemDynamicsBase(const bool is3DOF)
Constructs the dynamics base and sets the DOF flag.
Definition: SystemDynamicsBase.cpp:5
void setRbb(const std::array< double, 3 > &rbb)
Sets the centre-of-buoyancy position in the body frame.
Definition: SystemDynamicsBase.cpp:123
double getMassValue() const
Returns the vehicle mass in kg.
Definition: SystemDynamicsBase.h:144
const Vector3d & getFgn() const
Returns the gravitational force vector in the world frame.
Definition: SystemDynamicsBase.h:134
const bool isSystem3DOF
True if the vehicle is constrained to the XY-Yaw plane (3DOF surface vehicle)
Definition: SystemDynamicsBase.h:80
Matrix6d getC(const Vector6d &velocity) const
Evaluates the total Coriolis matrix C(v) = Crb(v) + Ca(v)
Definition: SystemDynamicsBase.cpp:45
double getWeight() const
Returns the vehicle weight in N.
Definition: SystemDynamicsBase.h:149
const Matrix6d & getMrb() const
Returns the rigid-body mass matrix Mrb.
Definition: SystemDynamicsBase.h:104
void setI(const std::array< double, 6 > &I)
Sets the rigid-body inertia tensor.
Definition: SystemDynamicsBase.cpp:91
Matrix6d getD(const Vector6d &velocity) const
Evaluates the total damping matrix D(v) = Dl + Dnl*diag(|v|)
Definition: SystemDynamicsBase.cpp:13
const Vector3d & getFbn() const
Returns the buoyancy force vector in the world frame.
Definition: SystemDynamicsBase.h:139
void setBuoyancy(double factor)
Sets the buoyancy force as a scale factor relative to vehicle weight.
Definition: SystemDynamicsBase.cpp:86
const Matrix6d & getMaMatrix() const
Returns the added-mass matrix Ma.
Definition: SystemDynamicsBase.h:109
Vector6d getG(const Quaterniond &q) const
Evaluates the 6DOF gravitational and buoyancy restoring vector G(q)
Definition: SystemDynamicsBase.cpp:49