Skip to content

Commit

Permalink
Feature/hydrodynamics (#749)
Browse files Browse the repository at this point in the history
Implement hydrodynamics and thruster plugin.

Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Mabel Zhang <[email protected]>
Co-authored-by: Carlos Agüero <[email protected]>
  • Loading branch information
3 people authored Apr 26, 2021
1 parent 51befb4 commit 9599770
Show file tree
Hide file tree
Showing 10 changed files with 1,194 additions and 0 deletions.
146 changes: 146 additions & 0 deletions examples/worlds/auv_controls.sdf
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<?xml version="1.0" ?>
<sdf version="1.6">
<world name="buoyant_tethys">
<scene>
<!-- For turquoise ambient -->
<ambient>0.0 1.0 1.0</ambient>
<background>0.0 0.7 0.8</background>
</scene>

<physics name="1ms" type="ode">
<max_step_size>0.001</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin
filename="ignition-gazebo-physics-system"
name="ignition::gazebo::systems::Physics">
</plugin>
<plugin
filename="ignition-gazebo-user-commands-system"
name="ignition::gazebo::systems::UserCommands">
</plugin>
<plugin
filename="ignition-gazebo-scene-broadcaster-system"
name="ignition::gazebo::systems::SceneBroadcaster">
</plugin>
<plugin
filename="ignition-gazebo-contact-system"
name="ignition::gazebo::systems::Contact">
</plugin>

<plugin
filename="ignition-gazebo-buoyancy-system"
name="ignition::gazebo::systems::Buoyancy">
<uniform_fluid_density>1000</uniform_fluid_density>
</plugin>

<light type="directional" name="sun">
<cast_shadows>true</cast_shadows>
<pose>0 0 10 0 0 0</pose>
<diffuse>1 1 1 1</diffuse>
<specular>0.5 0.5 0.5 1</specular>
<attenuation>
<range>1000</range>
<constant>0.9</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>-0.5 0.1 -0.9</direction>
</light>

<include>
<pose>0 0 1 0 0 1.57</pose>
<uri>https://fuel.ignitionrobotics.org/1.0/accurrent/models/MBARI%20Tethys%20LRAUV</uri>

<!-- Joint controllers -->
<plugin
filename="ignition-gazebo-joint-position-controller-system"
name="ignition::gazebo::systems::JointPositionController">
<joint_name>horizontal_fins_joint</joint_name>
<p_gain>0.1</p_gain>
</plugin>

<plugin
filename="ignition-gazebo-joint-position-controller-system"
name="ignition::gazebo::systems::JointPositionController">
<joint_name>vertical_fins_joint</joint_name>
<p_gain>0.1</p_gain>
</plugin>

<plugin
filename="ignition-gazebo-thruster-system"
name="ignition::gazebo::systems::Thruster">
<namespace>tethys</namespace>
<joint_name>propeller_joint</joint_name>
<thrust_coefficient>0.004422</thrust_coefficient>
<fluid_density>1000</fluid_density>
<propeller_diameter>0.2</propeller_diameter>
</plugin>

<!-- Lift and drag -->

<!-- Vertical fin -->
<plugin
filename="ignition-gazebo-lift-drag-system"
name="ignition::gazebo::systems::LiftDrag">
<air_density>1000</air_density>
<cla>4.13</cla>
<cla_stall>-1.1</cla_stall>
<cda>0.2</cda>
<cda_stall>0.03</cda_stall>
<alpha_stall>0.17</alpha_stall>
<a0>0</a0>
<area>0.0244</area>
<upward>0 1 0</upward>
<forward>1 0 0</forward>
<link_name>vertical_fins</link_name>
<cp>0 0 0</cp>
</plugin>

<!-- Horizontal fin -->
<plugin
filename="ignition-gazebo-lift-drag-system"
name="ignition::gazebo::systems::LiftDrag">
<air_density>1000</air_density>
<cla>4.13</cla>
<cla_stall>-1.1</cla_stall>
<cda>0.2</cda>
<cda_stall>0.03</cda_stall>
<alpha_stall>0.17</alpha_stall>
<a0>0</a0>
<area>0.0244</area>
<upward>0 0 1</upward>
<forward>1 0 0</forward>
<link_name>horizontal_fins</link_name>
<cp>0 0 0</cp>
</plugin>

<!-- hydrodynamics plugin-->
<plugin
filename="ignition-gazebo-hydrodynamics-system"
name="ignition::gazebo::systems::Hydrodynamics">
<link_name>base_link</link_name>
<xDotU>-4.876161</xDotU>
<yDotV>-126.324739</yDotV>
<zDotW>-126.324739</zDotW>
<kDotP>0</kDotP>
<mDotQ>-33.46</mDotQ>
<nDotR>-33.46</nDotR>
<xUU>-6.2282</xUU>
<xU>0</xU>
<yVV>-601.27</yVV>
<yV>0</yV>
<zWW>-601.27</zWW>
<zW>0</zW>
<kPP>-0.1916</kPP>
<kP>0</kP>
<mQQ>-632.698957</mQQ>
<mQ>0</mQ>
<nRR>-632.698957</nRR>
<nR>0</nR>
</plugin>

</include>

</world>
</sdf>
2 changes: 2 additions & 0 deletions src/systems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ add_subdirectory(camera_video_recorder)
add_subdirectory(detachable_joint)
add_subdirectory(diff_drive)
add_subdirectory(follow_actor)
add_subdirectory(hydrodynamics)
add_subdirectory(imu)
add_subdirectory(joint_controller)
add_subdirectory(joint_position_controller)
Expand All @@ -121,6 +122,7 @@ add_subdirectory(pose_publisher)
add_subdirectory(scene_broadcaster)
add_subdirectory(sensors)
add_subdirectory(thermal)
add_subdirectory(thruster)
add_subdirectory(touch_plugin)
add_subdirectory(triggered_publisher)
add_subdirectory(user_commands)
Expand Down
6 changes: 6 additions & 0 deletions src/systems/hydrodynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
gz_add_system(hydrodynamics
SOURCES
Hydrodynamics.cc
PUBLIC_LINK_LIBS
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
)
Loading

0 comments on commit 9599770

Please sign in to comment.