Skip to content

Commit

Permalink
merge from main; Allow choosing between barycentric and trilinear int…
Browse files Browse the repository at this point in the history
…erpolations

Signed-off-by: Mabel Zhang <[email protected]>
  • Loading branch information
mabelzhang committed Dec 23, 2021
2 parents 7c85554 + d3d77b0 commit 0af6a57
Show file tree
Hide file tree
Showing 36 changed files with 2,253 additions and 536 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ docker/join.sh mbari_lrauv
## To build

To run the code in this repository natively without Docker, make sure you have
[Ignition Fortress](https://ignitionrobotics.org/docs/fortress) and
[Ignition Garden](https://ignitionrobotics.org/docs/garden) and
[colcon](https://colcon.readthedocs.io/en/released/), on Ubuntu Focal or higher.

Install dependencies
Expand Down
5 changes: 3 additions & 2 deletions docker/debug_integration/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Research Institute (MBARI) and the David and Lucile Packard Foundation
#

FROM mbari/lrauv-ignition-sim
FROM mbari/lrauv-ignition-sim:garden

USER root

Expand All @@ -41,11 +41,12 @@ RUN apt-get update \

# 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' && \
/bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list' && \
/bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -'

# Install the latest Ignition binaries
RUN apt-get -qq update && apt-get -q -y install \
ignition-fortress
ignition-garden

# Install PCL
RUN apt-get update \
Expand Down
5 changes: 3 additions & 2 deletions docker/empty_world/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ RUN apt-get -qq update && apt-get -q -y install \
ENV IGN_WS /home/ign_ws
RUN mkdir -p ${IGN_WS}/src \
&& cd ${IGN_WS}/src \
&& wget https://raw.githubusercontent.com/ignition-tooling/gazebodistro/master/collection-fortress.yaml \
&& vcs import < collection-fortress.yaml
&& wget https://raw.githubusercontent.com/ignition-tooling/gazebodistro/master/collection-garden.yaml \
&& vcs import < collection-garden.yaml

# Install Ignition dependencies
# This parses Ignition source tree to find package dependencies
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' \
&& /bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list' \
&& /bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -' \
&& apt-get update \
&& apt-get install -y \
Expand Down
5 changes: 3 additions & 2 deletions docker/tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Research Institute (MBARI) and the David and Lucile Packard Foundation
#

FROM mbari/lrauv-ignition-sim
FROM mbari/lrauv-ignition-sim:garden

USER root

Expand All @@ -41,11 +41,12 @@ RUN apt-get update \

# 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' && \
/bin/sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list' && \
/bin/sh -c 'wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -'

# Install the latest Ignition binaries
RUN apt-get -qq update && apt-get -q -y install \
ignition-fortress
ignition-garden

# Install PCL
RUN apt-get update \
Expand Down
3 changes: 2 additions & 1 deletion lrauv_description/models/tethys_equipped/model.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
<command_topic>tethys/command_topic</command_topic>
<state_topic>tethys/state_topic</state_topic>
<debug_printout>0</debug_printout>
<ocean_density>1000</ocean_density>
</plugin>
<plugin
filename="HydrodynamicsPlugin"
Expand Down Expand Up @@ -180,7 +181,7 @@
</plugin>
<plugin
filename="ignition-gazebo-buoyancy-engine-system"
name="ignition::gazebo::v6::systems::BuoyancyEnginePlugin">
name="ignition::gazebo::systems::BuoyancyEngine">
<link_name>buoyancy_engine</link_name>
<namespace>tethys</namespace>
<fluid_density>1000</fluid_density>
Expand Down
39 changes: 28 additions & 11 deletions lrauv_ignition_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,20 @@ endif()
# Find dependencies
find_package(ignition-cmake2 REQUIRED)

find_package(ignition-gazebo6 REQUIRED COMPONENTS gui)
set(IGN_GAZEBO_VER ${ignition-gazebo6_VERSION_MAJOR})
find_package(ignition-gazebo7 REQUIRED COMPONENTS gui)
set(IGN_GAZEBO_VER ${ignition-gazebo7_VERSION_MAJOR})

find_package(ignition-gui6 REQUIRED)
set(IGN_GUI_VER ${ignition-gui6_VERSION_MAJOR})
find_package(ignition-gui7 REQUIRED)
set(IGN_GUI_VER ${ignition-gui7_VERSION_MAJOR})

find_package(ignition-sensors6 REQUIRED)
set(IGN_SENSORS_VER ${ignition-sensors6_VERSION_MAJOR})
find_package(ignition-rendering7 REQUIRED)
set(IGN_RENDERING_VER ${ignition-rendering7_VERSION_MAJOR})

find_package(ignition-msgs8 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs8_VERSION_MAJOR})
find_package(ignition-sensors7 REQUIRED)
set(IGN_SENSORS_VER ${ignition-sensors7_VERSION_MAJOR})

find_package(ignition-msgs9 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs9_VERSION_MAJOR})

find_package(ignition-plugin1 REQUIRED COMPONENTS register)
set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})
Expand All @@ -52,7 +55,7 @@ add_subdirectory(proto)
# Plugins

# add_lrauv_plugin (<plugin_name>
# [PROTO] msg1 msg2 ... [PCL] [GUI] [PRIVATE_LINK_LIBS] [INCLUDE_COMMS])
# [PROTO] msg1 msg2 ... [PCL] [GUI] [RENDERING] [PRIVATE_LINK_LIBS] [INCLUDE_COMMS])
#
# Configure and install plugins.
#
Expand All @@ -65,11 +68,13 @@ add_subdirectory(proto)
#
# [GUI]: Optional. Include for GUI plugins.
#
# [RENDERING]: Optional. Include to link against Ignition Rendering.
#
# [PRIVATE_LINK_LIBS]: Specify a list of libraries to be privately linked.
#
# [INCLUDE_COMMS]: Optional. Include comms header files.
function(add_lrauv_plugin PLUGIN)
set(options PCL GUI INCLUDE_COMMS)
set(options PCL GUI RENDERING INCLUDE_COMMS)
set(oneValueArgs)
set(multiValueArgs PROTO PRIVATE_LINK_LIBS)

Expand Down Expand Up @@ -138,6 +143,14 @@ function(add_lrauv_plugin PLUGIN)
PUBLIC ${PCL_INCLUDE_DIRS})
endif()

# Rendering
if (add_lrauv_plugin_RENDERING)
target_link_libraries(${PLUGIN}
PRIVATE
ignition-rendering${IGN_RENDERING_VER}::ignition-rendering${IGN_RENDERING_VER}
)
endif()

install(
TARGETS ${PLUGIN}
DESTINATION ${INSTALL_LIB})
Expand All @@ -152,14 +165,18 @@ add_lrauv_plugin(AcousticCommsPlugin
lrauv_internal_comms
PRIVATE_LINK_LIBS
CommsSupport)

add_lrauv_plugin(ControlPanelPlugin GUI
PROTO
lrauv_command
lrauv_state)
add_lrauv_plugin(HydrodynamicsPlugin)
add_lrauv_plugin(RangeBearingPlugin
INCLUDE_COMMS
PROTO
lrauv_range_bearing_request
lrauv_range_bearing_response
lrauv_acoustic_message)
add_lrauv_plugin(ReferenceAxis GUI RENDERING)
add_lrauv_plugin(ScienceSensorsSystem
PCL
PRIVATE_LINK_LIBS
Expand Down
28 changes: 28 additions & 0 deletions lrauv_ignition_plugins/data/interpolation_test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
elapsed_time_second,latitude_degree,longitude_degree,depth_meter,sea_water_temperature_degC,sea_water_salinity_psu,mass_concentration_of_chlorophyll_in_sea_water_ugram_per_liter,eastward_sea_water_velocity_meter_per_sec,northward_sea_water_velocity_meter_per_sec
0,-0.00009,-0.00003,0,0,0,100,-1,0
0,-0.00006,-0.00003,0,0,0,100,-1,0
0,-0.00003,-0.00003,0,0,0,100,-1,0
0,0.00000,-0.00003,0,0,0,100,-1,0
0,0.00003,-0.00003,0,0,0,100,-1,0
0,-0.00009,-0.00003,1,0,0,300,-1,0
0,-0.00006,-0.00003,1,0,0,300,-1,0
0,-0.00003,-0.00003,1,0,0,300,-1,0
0,0.00000,-0.00003,1,0,0,300,-1,0
0,0.00003,-0.00003,1,0,0,300,-1,0
0,-0.00009,0.00000,0,0,0,200,-1,0
0,-0.00006,0.00000,0,0,0,200,-1,0
0,-0.00003,0.00000,0,0,0,200,-1,0
0,-0.00001,0.00000,0,0,0,200,-1,0
0,0.00001,0.00000,0,0,0,300,-1,0
0,0.00002,0.00000,0,0,0,200,-1,0
0,0.00003,0.00000,0,0,0,200,-1,0
0,-0.00009,0.00003,0,0,0,300,-1,0
0,-0.00006,0.00003,0,0,0,300,-1,0
0,-0.00003,0.00003,0,0,0,300,-1,0
0,0.00000,0.00003,0,0,0,300,-1,0
0,0.00003,0.00003,0,0,0,300,-1,0
0,-0.00009,0.00003,1,0,0,100,-1,0
0,-0.00006,0.00003,1,0,0,100,-1,0
0,-0.00003,0.00003,1,0,0,100,-1,0
0,0.00000,0.00003,1,0,0,100,-1,0
0,0.00003,0.00003,1,0,0,100,-1,0
102 changes: 52 additions & 50 deletions lrauv_ignition_plugins/proto/lrauv_command.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,58 +37,60 @@ message LRAUVCommand
/// \brief Optional header data
ignition.msgs.Header header = 1;

float propOmega_ = 2; // Angular velocity that the controller
// believes the propeller is currently at.
// Unit: rad / s. Positive values rotate
// the propeller clockwise when looking
// from the back, and propel the vehicle
// forward.
float rudderAngle_ = 3; // Angle that the controller believes the
// rudder is currently at. Unit: radians.
// Higher values have the vertical fins
// rotated more clockwise when looking
// from the top (i.e. to starboard)
float elevatorAngle_ = 4; // Angle that the controller believes the
// elevator is currently at. Unit: radians.
// Higher values have the horizontal fins
// rotated more counter-clockwise when
// looking from starboard, which tilts the
// nose downward when moving forward.
float massPosition_ = 5; // Position where the controller believes
// the mass shifter's joint is in. Unit:
// meters. Positive values have the battery
// forward, tilting the nose downward.
float buoyancyPosition_ = 6; // Volume that the controller believes the
// VBS currently has. Unit: cubic meters.
// Volumes higher than the neutral volume
// push the vehicle upward.
bool dropWeightState_ = 7; // Indicator "dropweight OK"
// 1 = in place, 0 = dropped

float propOmegaAction_ = 8; // Target angular velocity for the
// propeller. Unit: rad / s. Positive
// values rotate the propeller clockwise
// when looking from the back, and propel
// the vehicle forward.
float rudderAngleAction_ = 9; // Target angle for rudder joint. Unit:
// radians. Higher values rotate the
// vertical fins clockwise when looking
// from the top (i.e. to starboard)
float elevatorAngleAction_ = 10; // Target angle for the elevator joint.
// Unit: radians. Higher values rotate
// vertical fins more counter-clockwise
// when looking from starboard, which tilts
// the nose downward when moving forward.
float massPositionAction_ = 11; // Target position for the battery's joint.
// Unit: meters. Positive values move the
// battery forward, tilting the nose
// downward.
float buoyancyAction_ = 12; // Target volume for the VBS (Variable
// Buoyancy System). Unit: cubic meters.
// Volumes higher than the neutral volume
// make the vehicle float.
/// \brief Angular velocity that the controller believes the propeller is currently at.
/// Unit: rad / s. Positive values rotate the propeller clockwise when looking from the
/// back, and propel the vehicle forward.
float propOmega_ = 2;

/// \brief Angle that the controller believes the rudder is currently at. Unit: radians.
/// Higher values have the vertical fins rotated more clockwise when looking from the
/// top (i.e. to starboard)
float rudderAngle_ = 3;

/// \brief Angle that the controller believes the elevator is currently at. Unit: radians.
/// Higher values have the horizontal fins rotated more counter-clockwise when looking
/// from starboard, which tilts the nose downward when moving forward.
float elevatorAngle_ = 4;

/// \brief Position where the controller believes the mass shifter's joint is in. Unit:
/// meters. Positive values have the battery forward, tilting the nose downward.
float massPosition_ = 5;

/// \brief Volume that the controller believes the VBS currently has. Unit: cubic meters.
/// Volumes higher than the neutral volume push the vehicle upward.
float buoyancyPosition_ = 6;

/// \brief Indicator "dropweight OK". 1 = in place, 0 = dropped
bool dropWeightState_ = 7;

/// \brief Target angular velocity for the propeller. Unit: rad / s. Positive
/// values rotate the propeller clockwise when looking from the back, and propel
/// the vehicle forward.
float propOmegaAction_ = 8;

/// \brief Target angle for rudder joint. Unit: radians. Higher values rotate the
/// vertical fins clockwise when looking from the top (i.e. to starboard)
float rudderAngleAction_ = 9;

/// \brief Target angle for the elevator joint. Unit: radians. Higher values rotate
/// vertical fins more counter-clockwise when looking from starboard, which tilts
/// the nose downward when moving forward.
float elevatorAngleAction_ = 10;

/// \brief Target position for the battery's joint. Unit: meters. Positive values move the
/// battery forward, tilting the nose downward.
float massPositionAction_ = 11;

/// \brief Target volume for the VBS (Variable Buoyancy System). Unit: cubic meters.
/// Volumes higher than the neutral volume make the vehicle float.
float buoyancyAction_ = 12;

/// \brief Not used
float density_ = 13;

/// \brief Not used
float dt_ = 14;

/// \brief Not used
double time_ = 15;
}
24 changes: 17 additions & 7 deletions lrauv_ignition_plugins/proto/lrauv_init.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,23 @@ message LRAUVInit
/// \brief Unique ID identifying vehicle
ignition.msgs.StringMsg id_ = 2;

// Initial Position Vector
double initLat_ = 3; // arcdeg // Initial latitude
double initLon_ = 4; // arcdeg // Initial longitude
double initZ_ = 5; // m // Initial depth
float initPitch_ = 6; // rad // Pitch wrto LV
float initRoll_ = 7; // rad // Roll wrto LV
float initHeading_ = 8; // rad // Yaw wrto LV
/// \brief Initial latitude in degrees.
double initLat_ = 3;

/// \brief Initial longitude in degrees.
double initLon_ = 4;

/// \brief Initial depth in meters.
double initZ_ = 5;

/// \TODO(chapulina)
float initPitch_ = 6;

/// \TODO(chapulina)
float initRoll_ = 7;

/// \TODO(chapulina)
float initHeading_ = 8;

// Add fields as needed
}
Loading

0 comments on commit 0af6a57

Please sign in to comment.