Skip to content

Commit 10a6d18

Browse files
author
henrykotze
committed
LTA Dynamics System
copy of Hydrodynamics folder, and rename to lta Renamed to LighterThanAirDynamics - Added some initial private data - Requires still alot of cleanup some initial dynamics added Building sucessfully with some warnings Running test to determine succesfull Spawning successfull ran tests, but still debugging alot Added additional debug messages Protection for zero division - Test running sucessfully with adding forces and torques, but requires more extensive testing and validation Improved Documentation,some more work on tests Improve documentation to include math Silver bullet model withs its coefficients small documentation update Code style updates. wip Style checks completed Small correction to dynamics Added Mass Force and Torques included - Link class now provides the FluidAddedMassMatrix Removed Munk from added mass & correct coeff names
1 parent e88a46f commit 10a6d18

10 files changed

+874
-0
lines changed

include/gz/sim/Link.hh

+9
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <vector>
2424

2525
#include <gz/math/Matrix3.hh>
26+
#include <gz/math/Matrix6.hh>
2627
#include <gz/math/Pose3.hh>
2728
#include <gz/math/Quaternion.hh>
2829
#include <gz/math/Vector3.hh>
@@ -269,6 +270,14 @@ namespace gz
269270
public: std::optional<math::Matrix3d> WorldInertiaMatrix(
270271
const EntityComponentManager &_ecm) const;
271272

273+
/// \brief Get the fluid added mass matrix in the world frame.
274+
/// \param[in] _ecm Entity-component manager.
275+
/// \return Fluide added matrix in world frame, returns nullopt if link
276+
/// does not have components components::Inertial and
277+
/// components::WorldPose.
278+
public: std::optional<math::Matrix6d> WorldFluidAddedMassMatrix(
279+
const EntityComponentManager &_ecm) const;
280+
272281
/// \brief Get the rotational and translational kinetic energy of the
273282
/// link with respect to the world frame.
274283
/// \param[in] _ecm Entity-component manager.

src/Link.cc

+12
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,18 @@ std::optional<math::Matrix3d> Link::WorldInertiaMatrix(
337337
math::Inertiald(inertial->Data().MassMatrix(), comWorldPose).Moi());
338338
}
339339

340+
std::optional<math::Matrix6d> Link::WorldFluidAddedMassMatrix(
341+
const EntityComponentManager &_ecm) const
342+
{
343+
auto inertial = _ecm.Component<components::Inertial>(this->dataPtr->id);
344+
auto worldPose = _ecm.Component<components::WorldPose>(this->dataPtr->id);
345+
346+
if (!worldPose || !inertial)
347+
return std::nullopt;
348+
349+
return inertial->Data().FluidAddedMass();
350+
}
351+
340352
//////////////////////////////////////////////////
341353
std::optional<double> Link::WorldKineticEnergy(
342354
const EntityComponentManager &_ecm) const

src/systems/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ add_subdirectory(joint_traj_control)
129129
add_subdirectory(kinetic_energy_monitor)
130130
add_subdirectory(label)
131131
add_subdirectory(lift_drag)
132+
add_subdirectory(lighter_than_air_dynamics)
132133
add_subdirectory(log)
133134
add_subdirectory(log_video_recorder)
134135
add_subdirectory(logical_audio_sensor_plugin)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
gz_add_system(lighter_than_air_dynamics
2+
SOURCES
3+
LighterThanAirDynamics.cc
4+
PUBLIC_LINK_LIBS
5+
gz-common${GZ_COMMON_VER}::gz-common${GZ_COMMON_VER}
6+
gz-math${GZ_MATH_VER}::eigen3
7+
)

0 commit comments

Comments
 (0)