|
controls
3.0.0
|
Base class encoding the 6DOF hydrodynamic model of a marine vehicle. More...
#include <SystemDynamicsBase.h>
Public Member Functions | |
| SystemDynamicsBase (const bool is3DOF) | |
| Constructs the dynamics base and sets the DOF flag. More... | |
| virtual | ~SystemDynamicsBase ()=default |
| Virtual destructor. More... | |
| const Matrix6d & | getM () const |
| Returns the total mass matrix M = Mrb + Ma. More... | |
| const Matrix6d & | getMrb () const |
| Returns the rigid-body mass matrix Mrb. More... | |
| const Matrix6d & | getMaMatrix () const |
| Returns the added-mass matrix Ma. More... | |
| const Matrix6d & | getDlMatrix () const |
| Returns the linear damping matrix Dl. More... | |
| const Matrix6d & | getDnlMatrix () const |
| Returns the quadratic damping matrix Dnl. More... | |
| const Vector3d & | getRgbVec () const |
| Returns the centre of gravity in the body frame. More... | |
| const Vector3d & | getRbbVec () const |
| Returns the centre of buoyancy in the body frame. More... | |
| const Vector3d & | getFgn () const |
| Returns the gravitational force vector in the world frame. More... | |
| const Vector3d & | getFbn () const |
| Returns the buoyancy force vector in the world frame. More... | |
| double | getMassValue () const |
| Returns the vehicle mass in kg. More... | |
| double | getWeight () const |
| Returns the vehicle weight in N. More... | |
| double | getBuoyancyValue () const |
| Returns the net buoyancy force in N. More... | |
| Matrix6d | getD (const Vector6d &velocity) const |
| Evaluates the total damping matrix D(v) = Dl + Dnl*diag(|v|) More... | |
| Matrix6d | getCrb (const Vector6d &velocity) const |
| Evaluates the rigid-body Coriolis matrix Crb(v) More... | |
| Matrix6d | getCa (const Vector6d &velocity) const |
| Evaluates the added-mass Coriolis matrix Ca(v) More... | |
| Matrix6d | getC (const Vector6d &velocity) const |
| Evaluates the total Coriolis matrix C(v) = Crb(v) + Ca(v) More... | |
| Vector6d | getG (const Quaterniond &q) const |
| Evaluates the 6DOF gravitational and buoyancy restoring vector G(q) More... | |
| Vector6d | getG (const Vector3d &rpy) const |
| Evaluates the 6DOF gravitational and buoyancy restoring vector G(rpy) More... | |
| 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. More... | |
| void | setMass (double m) |
| Sets vehicle mass and recomputes weight, buoyancy, and the rigid-body mass matrix. More... | |
| void | setBuoyancy (double factor) |
| Sets the buoyancy force as a scale factor relative to vehicle weight. More... | |
| void | setI (const std::array< double, 6 > &I) |
| Sets the rigid-body inertia tensor. More... | |
| void | setMa (const std::array< double, 6 > &m) |
| Sets the diagonal added-mass coefficients. More... | |
| void | setDl (const std::array< double, 6 > &d) |
| Sets the diagonal linear damping coefficients. More... | |
| void | setDnl (const std::array< double, 6 > &d) |
| Sets the diagonal quadratic (nonlinear) damping coefficients. More... | |
| void | setRbb (const std::array< double, 3 > &rbb) |
| Sets the centre-of-buoyancy position in the body frame. More... | |
| void | setRgb (const std::array< double, 3 > &rgb) |
| Sets the centre-of-gravity position in the body frame. More... | |
Public Attributes | |
| const bool | isSystem3DOF |
| True if the vehicle is constrained to the XY-Yaw plane (3DOF surface vehicle) More... | |
Base class encoding the 6DOF hydrodynamic model of a marine vehicle.
Stores mass, inertia, damping, and buoyancy parameters and provides methods to evaluate the Coriolis matrix C(v), damping matrix D(v), restoring vector G(q), and the inertial + Coriolis + damping expression M*a + C(v)*v + D(v)*v. G(q) is computed separately and applied by BuoyancyController. Subclasses may override getInverseDynamics() to zero out irrelevant DOFs.
Invariant: M_ = Mrb_ + Ma_ must hold after every mutation. All setters that modify Mrb_ or Ma_ call updateMass() to re-establish this.
|
explicit |
Constructs the dynamics base and sets the DOF flag.
| is3DOF | [in] True for a surface vehicle constrained to XY-Yaw |
|
virtualdefault |
Virtual destructor.
|
inline |
Returns the net buoyancy force in N.
Evaluates the total Coriolis matrix C(v) = Crb(v) + Ca(v)
| velocity | [in] 6DOF body-frame velocity |
Evaluates the added-mass Coriolis matrix Ca(v)
| velocity | [in] 6DOF body-frame velocity |
Evaluates the rigid-body Coriolis matrix Crb(v)
| velocity | [in] 6DOF body-frame velocity |
Evaluates the total damping matrix D(v) = Dl + Dnl*diag(|v|)
| velocity | [in] 6DOF body-frame velocity |
|
inline |
Returns the linear damping matrix Dl.
|
inline |
Returns the quadratic damping matrix Dnl.
|
inline |
Returns the buoyancy force vector in the world frame.
|
inline |
Returns the gravitational force vector in the world frame.
| Vector6d SystemDynamicsBase::getG | ( | const Quaterniond & | q | ) | const |
Evaluates the 6DOF gravitational and buoyancy restoring vector G(q)
| q | [in] Vehicle orientation as a unit quaternion |
| Vector6d SystemDynamicsBase::getG | ( | const Vector3d & | rpy | ) | const |
Evaluates the 6DOF gravitational and buoyancy restoring vector G(rpy)
| rpy | [in] Vehicle orientation as roll-pitch-yaw in radians |
|
virtual |
Computes the inertial + Coriolis + damping force M*a + C(v)*v + D(v)*v.
Does NOT include the gravitational/buoyancy restoring term G(q); that is handled separately by BuoyancyController. Subclasses may override this to zero out DOFs that are not actuated (e.g. Z, Roll, Pitch for a 3DOF vehicle).
| velocity | [in] 6DOF body-frame velocity |
| acceleration | [in] 6DOF body-frame acceleration |
| orientation | [in] Vehicle orientation as a unit quaternion (unused in base implementation) |
Reimplemented in AsvSystemDynamics.
|
inline |
Returns the total mass matrix M = Mrb + Ma.
|
inline |
Returns the added-mass matrix Ma.
|
inline |
Returns the vehicle mass in kg.
|
inline |
Returns the rigid-body mass matrix Mrb.
|
inline |
Returns the centre of buoyancy in the body frame.
|
inline |
Returns the centre of gravity in the body frame.
|
inline |
Returns the vehicle weight in N.
| void SystemDynamicsBase::setBuoyancy | ( | double | factor | ) |
Sets the buoyancy force as a scale factor relative to vehicle weight.
| factor | [in] Buoyancy scale factor (1.0 = neutrally buoyant) |
| void SystemDynamicsBase::setDl | ( | const std::array< double, 6 > & | d | ) |
Sets the diagonal linear damping coefficients.
| d | [in] Array of 6 diagonal linear damping values [Dl_x, ..., Dl_r] |
| void SystemDynamicsBase::setDnl | ( | const std::array< double, 6 > & | d | ) |
Sets the diagonal quadratic (nonlinear) damping coefficients.
| d | [in] Array of 6 diagonal quadratic damping values [Dnl_x, ..., Dnl_r] |
| void SystemDynamicsBase::setI | ( | const std::array< double, 6 > & | I | ) |
Sets the rigid-body inertia tensor.
| I | [in] Array of 6 inertia components [Ixx, Iyy, Izz, Ixy, Ixz, Iyz] |
| void SystemDynamicsBase::setMa | ( | const std::array< double, 6 > & | m | ) |
Sets the diagonal added-mass coefficients.
| m | [in] Array of 6 diagonal added-mass values [Ma_x, Ma_y, Ma_z, Ma_p, Ma_q, Ma_r] |
| void SystemDynamicsBase::setMass | ( | double | m | ) |
Sets vehicle mass and recomputes weight, buoyancy, and the rigid-body mass matrix.
The existing buoyancy-to-weight ratio is preserved when mass changes.
| m | [in] Vehicle mass in kg |
| void SystemDynamicsBase::setRbb | ( | const std::array< double, 3 > & | rbb | ) |
Sets the centre-of-buoyancy position in the body frame.
| rbb | [in] Array of 3 coordinates [x, y, z] in metres |
| void SystemDynamicsBase::setRgb | ( | const std::array< double, 3 > & | rgb | ) |
Sets the centre-of-gravity position in the body frame.
| rgb | [in] Array of 3 coordinates [x, y, z] in metres |
| const bool SystemDynamicsBase::isSystem3DOF |
True if the vehicle is constrained to the XY-Yaw plane (3DOF surface vehicle)