Line data Source code
1 : #ifndef CONTROLS_DYNAMICS_ASV_SYSTEM_DYNAMICS_H 2 : #define CONTROLS_DYNAMICS_ASV_SYSTEM_DYNAMICS_H 3 : 4 : #include <dynamics/SystemDynamicsBase.h> 5 : 6 : /** 7 : * @brief 3DOF hydrodynamic model for the autonomous surface vehicle 8 : * 9 : * Inherits the dynamics from SystemDynamicsBase with isSystem3DOF = true and 10 : * overrides getInverseDynamics() to zero the Z, Roll, and Pitch force components, 11 : * constraining the vehicle to the XY-Yaw plane. 12 : * Parameters are loaded at runtime via ROS parameters in ControlsROS2Wrapper. 13 : */ 14 1 : class AsvSystemDynamics : public SystemDynamicsBase { 15 : public: 16 : /** 17 : * @brief Constructs the ASV dynamics model as a 3DOF (XY-Yaw) system 18 : */ 19 1 : AsvSystemDynamics(); 20 : 21 : /** 22 : * @brief Computes inverse dynamics and zeros the Z, Roll, and Pitch components 23 : * 24 : * @param velocity [in] 6DOF body-frame velocity 25 : * @param acceleration [in] 6DOF body-frame acceleration 26 : * @param orientation [in] Vehicle orientation as a unit quaternion 27 : * 28 : * @return 6-element force vector with Z, Roll, and Pitch entries set to zero 29 : */ 30 1 : Vector6d getInverseDynamics(const Vector6d& velocity, const Vector6d& acceleration, 31 : const Quaterniond& orientation) const override; 32 : }; 33 : 34 : #endif // CONTROLS_DYNAMICS_ASV_SYSTEM_DYNAMICS_H