Skip to content

Commit

Permalink
Auto generated model. (#89)
Browse files Browse the repository at this point in the history
* rigid body

Signed-off-by: Arjo Chakravarty <[email protected]>

* Setting center of mass

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add drop weights... Leads to oscillation

Signed-off-by: Arjo Chakravarty <[email protected]>

* shift COM of main body forward craft is now stable.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Added mass shifter craaazy oscillations are back

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add description generator script

Signed-off-by: Arjo Chakravarty <[email protected]>

* Automate pipeline

Signed-off-by: Arjo Chakravarty <[email protected]>

* we are generating a new sdf

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add unit test framework

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add hydrostatics test

Signed-off-by: Arjo Chakravarty <[email protected]>

* remove model

Signed-off-by: Arjo Chakravarty <[email protected]>

* make fast

Signed-off-by: Arjo Chakravarty <[email protected]>

* stop debug printouts

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add second test WIP

Signed-off-by: Arjo Chakravarty <[email protected]>

* fix compile issue

Signed-off-by: Arjo Chakravarty <[email protected]>

* fix CMake file

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add joint controllers

Signed-off-by: Arjo Chakravarty <[email protected]>

* Stable fins

Signed-off-by: Arjo Chakravarty <[email protected]>

* remove ignition for now its not needed

Signed-off-by: Arjo Chakravarty <[email protected]>

* Stavle thruster

Signed-off-by: Arjo Chakravarty <[email protected]>

* update plugin list

Signed-off-by: Arjo Chakravarty <[email protected]>

* better constraints

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add Buoyancy Engine

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add buoyancy engine

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add newline at EOF

Signed-off-by: Arjo Chakravarty <[email protected]>

* Undo changes  in tethys_equipped.

Signed-off-by: Arjo Chakravarty <[email protected]>

* Update expectation

Signed-off-by: Arjo Chakravarty <[email protected]>

* white space correction

Signed-off-by: Arjo Chakravarty <[email protected]>

* tag images to use recent fortress release

Signed-off-by: Arjo Chakravarty <[email protected]>

* Add numpy as a dependency

Signed-off-by: Arjo Chakravarty <[email protected]>

* formatting

Signed-off-by: Arjo Chakravarty <[email protected]>

* better debug

Signed-off-by: Arjo Chakravarty <[email protected]>

* bump garden

Signed-off-by: Arjo Chakravarty <[email protected]>

* Update lrauv_description/test/test_hydrostatic_stability.cc

Co-authored-by: Louise Poubel <[email protected]>

* Update lrauv_description/test/test_hydrostatic_stability.cc

Co-authored-by: Louise Poubel <[email protected]>

* change location of python3-numpy

Signed-off-by: Arjo Chakravarty <[email protected]>

* rename worlds

Signed-off-by: Arjo Chakravarty <[email protected]>

* Address @mabelzhang's points

Signed-off-by: Arjo Chakravarty <[email protected]>

* update hytdrostatics test

Signed-off-by: Arjo Chakravarty <[email protected]>

* Fix coilision volumes.

Signed-off-by: Arjo Chakravarty <[email protected]>

* remove gravity. tag

Signed-off-by: Arjo Chakravarty <[email protected]>

* style fix

Signed-off-by: Arjo Chakravarty <[email protected]>

* loosen tolerances, the vehicle is oscillating more

Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
  • Loading branch information
arjo129 and chapulina authored Jan 6, 2022
1 parent 62c63a0 commit 41b2419
Show file tree
Hide file tree
Showing 15 changed files with 535 additions and 73 deletions.
3 changes: 2 additions & 1 deletion docker/debug_integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ RUN apt-get update \
gnupg2 \
lsb-release \
tzdata \
wget
wget \
python3-numpy

# Add Ignition's latest packages, which may be more up-to-date than the ones from the MBARI image
RUN /bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' && \
Expand Down
1 change: 1 addition & 0 deletions docker/empty_world/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ RUN apt-get update \
software-properties-common \
sudo \
vim \
python3-numpy
&& apt-get clean

# setup timezone
Expand Down
3 changes: 2 additions & 1 deletion docker/tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ RUN apt-get update \
gnupg2 \
lsb-release \
tzdata \
wget
wget \
python3-numpy

# Add Ignition's latest packages, which may be more up-to-date than the ones from the MBARI image
RUN /bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' && \
Expand Down
58 changes: 58 additions & 0 deletions lrauv_description/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,70 @@ cmake_minimum_required(VERSION 3.5)

project(lrauv_description)


#============================================================================
# Hooks
configure_file(
"hooks/hook.dsv.in"
"${CMAKE_CURRENT_BINARY_DIR}/hooks/hook.dsv" @ONLY
)

#============================================================================
# Model Generation
add_custom_command(
OUTPUT modelsdf
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/scripts/description_generator.py
${CMAKE_CURRENT_SOURCE_DIR}/models/tethys/model.sdf.in
${CMAKE_CURRENT_BINARY_DIR}/models/tethys/model.sdf
)

add_custom_target(generate_model ALL
DEPENDS modelsdf
)

install(DIRECTORY
models
${CMAKE_CURRENT_BINARY_DIR}/hooks
DESTINATION share/${PROJECT_NAME})

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/models/tethys/model.sdf
DESTINATION share/${PROJECT_NAME}/models/tethys
)

#============================================================================
# Tests
if(BUILD_TESTING)

find_package(ignition-gazebo7 REQUIRED)
set(IGN_GAZEBO_VER ${ignition-gazebo7_VERSION_MAJOR})

# Fetch and configure GTest
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)

enable_testing()
include(Dart)

# Build-time constants
set("PROJECT_BINARY_PATH" ${CMAKE_CURRENT_BINARY_DIR})
set("PROJECT_SOURCE_PATH" ${CMAKE_CURRENT_SOURCE_DIR})
configure_file(test/helper/TestConstants.hh.in TestConstants.hh @ONLY)

include(GoogleTest)

add_executable(test_hydrostatic_stability test/test_hydrostatic_stability.cc)
target_include_directories(test_hydrostatic_stability
PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_hydrostatic_stability
PUBLIC gtest_main
PRIVATE ignition-gazebo${IGN_GAZEBO_VER}::ignition-gazebo${IGN_GAZEBO_VER}
)

gtest_discover_tests(test_hydrostatic_stability)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,24 @@
<link name="base_link">
<inertial>
<!-- to offset battery CoM before getting real parameters for vehicle without battery -->
<!--pose>0 0.0236 0 0 0 0</pose-->
<pose>@calculated</pose>
<!-- 146.5671 subtracted by battery mass -->
<mass>114.8364</mass>
<mass>@calculated</mass>
<!--<mass>146.5671</mass>-->
<!-- TODO: Get inertial matrix of base link WITHOUT battery -->
<inertia>
<!--ixx>3.000000</ixx>
<ixx>3.000000</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>41.980233</iyy>
<iyz>0</iyz>
<izz>41.980233</izz-->

<!-- Guesstimated (decreased by 1/5) to account for battery -->
<ixx>2.4</ixx>
<ixy>0</ixy>
<ixz>0.0004</ixz>
<iyy>33.5841864</iyy>
<iyz>0</iyz>
<izz>33.5841864</izz>
<izz>41.980233</izz>

</inertia>
</inertial>

<collision name="main_body_buoyancy">
<pose>0 0 0.007 0 0 0</pose>
<geometry>
<box>
<size>2 0.3 0.245945166667</size>
</box>
</geometry>
@calculated
</collision>

<visual name="visual">
Expand Down Expand Up @@ -75,7 +63,6 @@
<link name="horizontal_fins">
<pose>1.05 0 0 0 0 0</pose>
<inertial>
<pose>0 0 0 1.57 0 0.5</pose>
<mass>0.2</mass>
<inertia>
<ixx>0.0007924568755</ixx>
Expand All @@ -87,12 +74,8 @@
</inertia>
</inertial>

<collision name="collision">
<geometry>
<box>
<size>0.1 0.1 0.02</size>
</box>
</geometry>
<collision name="horizontal_fins_buoyancy">
@neutral_buoyancy
</collision>

<visual name= "visual">
Expand Down Expand Up @@ -141,12 +124,8 @@
</inertia>
</inertial>

<collision name="collision">
<geometry>
<box>
<size>0.1 0.1 0.02</size>
</box>
</geometry>
<collision name="vertical_fin_buoyancy">
@neutral_buoyancy
</collision>

<visual name= "visual">
Expand Down Expand Up @@ -196,12 +175,8 @@
</inertia>
</inertial>

<collision name="collision">
<geometry>
<box>
<size>0.03 0.1 0.03</size>
</box>
</geometry>
<collision name="propeller_buoyancy">
@neutral_buoyancy
</collision>

<visual name= "visual">
Expand Down Expand Up @@ -239,11 +214,11 @@
<!-- No separate collision for battery, because it is inside the vehicle.
Additional collision requires buoyancy volume recalculation. -->
<link name="battery">
<!-- TODO: On hold till mesh center adjusted to aft dome, then it will be 0.563, 0, 0.024. -->
<pose>0 0 0 0 0 0</pose>
<!--TODO: On hold till mesh center adjusted to aft dome, then it will be 0.563, 0, 0.024.-->

<inertial>
<!-- Non-zero y creates roll. Not fun to tune without actual base link inertia minus battery-->
<!--pose>0 -0.0236 0 0 0 0</pose-->
<pose>-0.563 0 0 0 0 0</pose>
<mass>31.7307</mass>
<inertia>
<ixx>0.2327</ixx>
Expand All @@ -258,7 +233,6 @@
<visual name= "visual">
<geometry>
<box>
<!-- z is guesstimated from schematics. Visual doesn't matter. -->
<size>0.6489446 0.24638 0.17415</size>
</box>
</geometry>
Expand All @@ -271,7 +245,7 @@

<link name="buoyancy_engine">
<!-- TODO: Determine location of buoyancy engine -->
<pose>0.4 0 0 0 0 0</pose>
<pose>0.137 0 0 0 0 0</pose>

<!-- TODO: Remove inertial and collision
Expand All @@ -297,12 +271,8 @@
<izz>0.000033571862</izz>
</inertia>
</inertial>
<collision name="collision">
<geometry>
<box>
<size>0.03 0.1 0.1</size>
</box>
</geometry>
<collision name="buoyancy_engine">
@neutral_buoyancy
</collision>
</link>

Expand Down Expand Up @@ -342,7 +312,7 @@
</limit>
</axis>
</joint>

<joint name="propeller_joint" type="revolute">
<pose degrees="true">0 0 0 0 180 0</pose>
<parent>base_link</parent>
Expand Down Expand Up @@ -376,20 +346,15 @@

<!-- Drop weight -->
<link name="drop_weight">
<pose>0 0 0 0 0 0</pose>
<pose>0.128 0 0 0 0 0</pose>
<inertial>
<pose>0 0 0 0 0 0</pose>
<mass>1</mass>
<inertia>
<ixx>0.000143971303</ixx>
<ixy>0.000000000008</ixy>
<ixz>-0.000000000224</ixz>
<iyy>0.000140915448</iyy>
<iyz>-0.000025236433</iyz>
<izz>0.000033571862</izz>
</inertia>
</inertial>
</link>

</model>
</sdf>
Loading

0 comments on commit 41b2419

Please sign in to comment.