Skip to content

Commit 78a99a2

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 Signed-off-by: henrykotze <henry@flycloudline.com> update year Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> update format suggestion Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> update format suggestion in added_mass_force Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> format fix: function header Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> update formatting Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> Update src/systems/lighter_than_air_dynamics/LighterThanAirDynamics.hh Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> update year Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> Functionality updates and style updates Signed-off-by: henrykotze <henry@flycloudline.com> Example added for Lighter-than-air envelope Signed-off-by: henrykotze <henry@flycloudline.com> Use numerical limits to query precision of types Signed-off-by: henrykotze <henry@flycloudline.com> fix integration path for sdf file Signed-off-by: henrykotze <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> update year Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> style format update Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Signed-off-by: Henry Kotzé <henry@flycloudline.com> remove commented wind component
1 parent e88a46f commit 78a99a2

File tree

10 files changed

+957
-0
lines changed

10 files changed

+957
-0
lines changed
+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" ?>
2+
<sdf version="1.6">
3+
<world name="blimp">
4+
5+
<physics name="1ms" type="ode">
6+
<max_step_size>0.001</max_step_size>
7+
<!-- Zero to run as fast as possible -->
8+
<real_time_factor>1</real_time_factor>
9+
</physics>
10+
11+
<gravity>0 0 -9.81</gravity>
12+
13+
<plugin
14+
filename="ignition-gazebo-physics-system"
15+
name="gz::sim::systems::Physics">
16+
</plugin>
17+
<plugin
18+
filename="gz-sim-user-commands-system"
19+
name="gz::sim::systems::UserCommands">
20+
</plugin>
21+
<plugin
22+
filename="gz-sim-scene-broadcaster-system"
23+
name="gz::sim::systems::SceneBroadcaster">
24+
</plugin>
25+
26+
<plugin
27+
filename="gz-sim-buoyancy-system"
28+
name="gz::sim::systems::Buoyancy">
29+
<uniform_fluid_density>1.097</uniform_fluid_density>
30+
</plugin>
31+
32+
<light type="directional" name="sun">
33+
<cast_shadows>true</cast_shadows>
34+
<pose>0 0 10 0 0 0</pose>
35+
<diffuse>1 1 1 1</diffuse>
36+
<specular>0.5 0.5 0.5 1</specular>
37+
<attenuation>
38+
<range>1000</range>
39+
<constant>0.9</constant>
40+
<linear>0.01</linear>
41+
<quadratic>0.001</quadratic>
42+
</attenuation>
43+
<direction>-0.5 0.1 -0.9</direction>
44+
</light>
45+
46+
<model name="ground_plane">
47+
<static>true</static>
48+
<link name="link">
49+
<collision name="collision">
50+
<geometry>
51+
<plane>
52+
<normal>0 0 1</normal>
53+
<size>100 100</size>
54+
</plane>
55+
</geometry>
56+
</collision>
57+
<visual name="visual">
58+
<geometry>
59+
<plane>
60+
<normal>0 0 1</normal>
61+
<size>100 100</size>
62+
</plane>
63+
</geometry>
64+
<material>
65+
<ambient>0.8 0.8 0.8 1</ambient>
66+
<diffuse>0.8 0.8 0.8 1</diffuse>
67+
<specular>0.8 0.8 0.8 1</specular>
68+
</material>
69+
</visual>
70+
</link>
71+
</model>
72+
<include>
73+
<uri>
74+
https://fuel.gazebosim.org/1.0/hkotze/models/airship
75+
</uri>
76+
</include>
77+
</world>
78+
</sdf>

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)