Skip to content

Commit

Permalink
Loading Science Data into Sensors (#86)
Browse files Browse the repository at this point in the history
* Science data implementation using PCL Octree kNN for spatial search

Signed-off-by: Mabel Zhang <[email protected]>

Co-authored-by: Louise Poubel <[email protected]>
  • Loading branch information
mabelzhang and chapulina committed Nov 2, 2021
1 parent 3f58752 commit d43fc5e
Show file tree
Hide file tree
Showing 12 changed files with 296,090 additions and 29 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ This repository contains packages for simulating the MBARI Tethys.
Make sure you have [ignition-fortress](https://ignitionrobotics.org/docs/fortress) and
[colcon](https://colcon.readthedocs.io/en/released/), on Ubuntu Focal or higher.

Install dependencies
```
sudo apt-get install libpcl-dev
```

Clone this repository then run
```
colcon build
Expand Down Expand Up @@ -328,3 +333,19 @@ Make sure to use
quick on
```
to let the system finish loading, before issuing control commands.

# Science data

Science data can be read from a csv file with the following recognized field
names in the first line of the file:
```
elapsed_time_second
northings_meter
eastings_meter
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
```
5 changes: 5 additions & 0 deletions docker/tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ RUN apt-get -qq update && apt-get -q -y install \
python3-colcon-common-extensions \
ignition-fortress

# Install PCL
RUN apt-get update \
&& apt-get install -y \
libpcl-dev

# Clean up apt
RUN rm -rf /var/lib/apt/lists/* \
&& apt-get -qq clean
Expand Down
27 changes: 22 additions & 5 deletions lrauv_ignition_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,34 @@ set(IGN_UTILS_VER ${ignition-utils1_VERSION_MAJOR})

find_package (Eigen3 3.3 REQUIRED)

find_package(PCL 1.2 REQUIRED)

# Build protobuf messages
add_subdirectory(proto)

#============================================================================
# Plugins

# add_lrauv_plugin (<plugin_name>
# [PROTO])
# [PROTO] [PCL] [PRIVATE_LINK_LIBS])
#
# Configure and install plugins.
#
# <plugin_name> Required. Name of the plugin library, which matches source file.
#
# [PROTO]: Optional. If included, plugin will be linked against custom protobuf messages.
# [PROTO]: Optional. If included, plugin will be linked against custom protobuf
# messages.
#
# [PCL]: Optional. If included, plugin will be linked against PCL.
#
# [PRIVATE_LINK_LIBS]: Specify a list of libraries to be privately linked.
function(add_lrauv_plugin PLUGIN)
set(options PROTO)
set(options PROTO PCL)
set(oneValueArgs)
set(multiValueArgs PRIVATE_LINK_LIBS)

cmake_parse_arguments(add_lrauv_plugin "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
cmake_parse_arguments(add_lrauv_plugin
"${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

add_library(${PLUGIN} SHARED src/${PLUGIN}.cc)
set_property(TARGET ${PLUGIN} PROPERTY CXX_STANDARD 17)
Expand All @@ -69,6 +75,14 @@ function(add_lrauv_plugin PLUGIN)

endif()

# Include PCL
if (add_lrauv_plugin_PCL)

target_include_directories(${PLUGIN}
PUBLIC ${PCL_INCLUDE_DIRS})

endif()

install(
TARGETS ${PLUGIN}
DESTINATION lib)
Expand All @@ -79,8 +93,10 @@ add_lrauv_plugin(BuoyancyEnginePlugin)
add_lrauv_plugin(HydrodynamicsPlugin)
add_lrauv_plugin(JointPositionPlugin)
add_lrauv_plugin(ScienceSensorsSystem
PCL
PRIVATE_LINK_LIBS
ignition-sensors${IGN_SENSORS_VER}::ignition-sensors${IGN_SENSORS_VER})
ignition-sensors${IGN_SENSORS_VER}::ignition-sensors${IGN_SENSORS_VER}
${PCL_LIBRARIES})
add_lrauv_plugin(TethysCommPlugin PROTO)
add_lrauv_plugin(ThrusterPlugin)
add_lrauv_plugin(TimeAnalysisPlugin)
Expand Down Expand Up @@ -167,6 +183,7 @@ endif()

install(
DIRECTORY
data
launch
models
worlds
Expand Down
295,537 changes: 295,537 additions & 0 deletions lrauv_ignition_plugins/data/2003080103_mb_l3_las.csv

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lrauv_ignition_plugins/hooks/hook.dsv.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ prepend-non-duplicate;IGN_LAUNCH_PLUGIN_PATH;@CMAKE_INSTALL_PREFIX@/lib

prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;@CMAKE_INSTALL_PREFIX@/share/@PROJECT_NAME@/worlds
prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;@CMAKE_INSTALL_PREFIX@/share/@PROJECT_NAME@/models
prepend-non-duplicate;IGN_GAZEBO_RESOURCE_PATH;@CMAKE_INSTALL_PREFIX@/share/@PROJECT_NAME@/data
prepend-non-duplicate;IGN_GAZEBO_SYSTEM_PLUGIN_PATH;@CMAKE_INSTALL_PREFIX@/lib

prepend-non-duplicate;LD_LIBRARY_PATH;@CMAKE_INSTALL_PREFIX@/lib
2 changes: 1 addition & 1 deletion lrauv_ignition_plugins/src/BuoyancyEnginePlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace tethys
const ignition::gazebo::UpdateInfo &_info,
ignition::gazebo::EntityComponentManager &_ecm);

/// Inherits documentation from parent class
/// \brief Private data pointer
private: std::unique_ptr<BuoyancyEnginePrivateData> dataPtr;
};
}
Expand Down
2 changes: 1 addition & 1 deletion lrauv_ignition_plugins/src/HydrodynamicsPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ double SdfParamDouble(


HydrodynamicsPlugin::HydrodynamicsPlugin()
: dataPtr(std::make_unique<HydrodynamicsPrivateData>())
{
this->dataPtr = std::make_unique<HydrodynamicsPrivateData>();
}

void HydrodynamicsPlugin::Configure(
Expand Down
4 changes: 2 additions & 2 deletions lrauv_ignition_plugins/src/JointPositionPlugin.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ namespace tethys
const ignition::gazebo::UpdateInfo &_info,
ignition::gazebo::EntityComponentManager &_ecm);

/// Inherits documentation from parent class
/// \brief Private data pointer
private: std::unique_ptr<TethysJointPrivateData> dataPtr;
};
}

#endif
#endif
Loading

0 comments on commit d43fc5e

Please sign in to comment.