Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buoyancy plugin refactor #500

Merged
merged 16 commits into from
Sep 8, 2022
23 changes: 20 additions & 3 deletions vrx_ign/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ find_package(ignition-plugin1 REQUIRED COMPONENTS loader register)
set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})
find_package(ignition-rendering6 REQUIRED)
set(IGN_RENDERING_VER ${ignition-rendering6_VERSION_MAJOR})
find_package(ignition-utils1 REQUIRED)
set(IGN_UTILS_VER ${ignition-utils1_VERSION_MAJOR})
find_package(sdformat12 REQUIRED)

find_package(std_msgs REQUIRED)
Expand All @@ -44,10 +46,25 @@ install(
TARGETS Waves
DESTINATION lib)

# Buoyancy
add_library(SimpleBuoyancy SHARED
src/SimpleBuoyancy.cc
src/PolyhedronVolume.cc
src/ShapeVolume.cc
)
target_link_libraries(SimpleBuoyancy PUBLIC
ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER}
ignition-gazebo${IGN_GAZEBO_VER}::core
ignition-math${IGN_MATH_VER}
Waves
)
install(
TARGETS SimpleBuoyancy
DESTINATION lib)

# Plugins
list(APPEND VRX_IGN_PLUGINS
SimpleHydrodynamics
Surface
WaveVisual
)

Expand All @@ -57,8 +74,9 @@ foreach(PLUGIN ${VRX_IGN_PLUGINS})
ignition-gazebo${IGN_GAZEBO_VER}::core
ignition-plugin${IGN_PLUGIN_VER}::ignition-plugin${IGN_PLUGIN_VER}
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
ignition-utils${IGN_UTILS_VER}::ignition-utils${IGN_UTILS_VER}
Waves
)
)
endforeach()

install(
Expand All @@ -78,5 +96,4 @@ install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME})


ament_package()
59 changes: 49 additions & 10 deletions vrx_ign/models/wam-v/model.sdf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,54 @@ end
</plugin>

<plugin
filename="libSurface.so"
name="vrx::Surface">
<link_name>base_link</link_name>
<vehicle_length>4.9</vehicle_length>
<vehicle_width>2.4</vehicle_width>
<hull_radius>0.213</hull_radius>
<fluid_level>0</fluid_level>

<!-- Waves -->
filename="libSimpleBuoyancy.so"
name="vrx::SimpleBuoyancy">
<fluid_density>1000</fluid_density>
<fluid_level>0.0</fluid_level>
<linear_drag>20.0</linear_drag>
caguero marked this conversation as resolved.
Show resolved Hide resolved
<angular_drag>2.0</angular_drag>
<!-- Left Hull -->
<buoyancy name="left_hull_mid">
<link_name>base_link</link_name>
<pose>0.6 1.03 0.2 0 1.57 0</pose>
<geometry>
<cylinder>
<length>2</length>
<radius>0.2</radius>
</cylinder>
</geometry>
</buoyancy>
<buoyancy name="left_hull_rear">
<link_name>base_link</link_name>
<pose>-1.4 1.03 0.2 0 1.57 0</pose>
<geometry>
<cylinder>
<length>2</length>
<radius>0.2</radius>
</cylinder>
</geometry>
</buoyancy>
<!-- Right Hull -->
<buoyancy name="right_hull_mid">
<link_name>base_link</link_name>
<pose>0.6 -1.03 0.2 0 1.57 0</pose>
<geometry>
<cylinder>
<length>2</length>
<radius>0.2</radius>
</cylinder>
</geometry>
</buoyancy>
<buoyancy name="right_hull_rear">
<link_name>base_link</link_name>
<pose>-1.4 -1.03 0.2 0 1.57 0</pose>
<geometry>
<cylinder>
<length>2</length>
<radius>0.2</radius>
</cylinder>
</geometry>
</buoyancy>
<wavefield>
<size><%= $wavefield_size%> <%= $wavefield_size%></size>
<cell_count><%= $wavefield_cell_count%> <%=$wavefield_cell_count%></cell_count>
Expand All @@ -87,7 +126,7 @@ end
<period>5.0</period>
<number>3</number>
<scale>1.1</scale>
<gain>0.5</gain>
<gain>0.3</gain>
<direction>1 0</direction>
<angle>0.4</angle>
<tau>2.0</tau>
Expand Down
Loading