From 1f3088ed5a7dd1556dfa5fbb9829a060ce5e261a Mon Sep 17 00:00:00 2001 From: Woensug Choi Date: Tue, 18 Jan 2022 19:32:18 +0900 Subject: [PATCH 1/8] flag for how many tiles to keep --- .../dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc b/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc index 0b8a4a5b..d06d6ee0 100644 --- a/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc +++ b/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc @@ -43,6 +43,7 @@ struct bathy_grid_t { std::string prefix; int priority; + int tiles_to_keep; // lower-left-hand-corner. double anchor_lat; @@ -91,6 +92,7 @@ namespace gazebo bg->prefix = gridSDF->Get("prefix"); bg->priority = gridSDF->Get("priority"); + bg->tiles_to_keep = gridSDF->Get("tiles_to_keep"); bg->anchor_lat = gridSDF->Get("anchor_lat"); bg->anchor_lon = gridSDF->Get("anchor_lon"); bg->spacing_lat = gridSDF->Get("spacing_lat"); @@ -434,7 +436,7 @@ namespace gazebo } // Perform delayed removal - if (delayRemoveList.size() >= 1) + if (delayRemoveList.size() >= this->bathy_grids[nn]->tiles_to_keep) { std::string modelnamestr = delayRemoveList.front(); delayRemoveList.erase(delayRemoveList.begin()); From 9b51079467722332db510fe23a41c9f1a93b39da Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Tue, 18 Jan 2022 14:32:35 -0500 Subject: [PATCH 2/8] Export dave_gazebo_world_plugins_msgs library (#179) * export dave_gazebo_world_plugins_msgs Signed-off-by: Mabel Zhang * tabs -> spaces Signed-off-by: Mabel Zhang --- gazebo/dave_gazebo_world_plugins/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gazebo/dave_gazebo_world_plugins/CMakeLists.txt b/gazebo/dave_gazebo_world_plugins/CMakeLists.txt index 001a5088..070632c2 100644 --- a/gazebo/dave_gazebo_world_plugins/CMakeLists.txt +++ b/gazebo/dave_gazebo_world_plugins/CMakeLists.txt @@ -44,15 +44,16 @@ message(STATUS "GAZEBO_MSG_INCLUDE_DIRS = " ${GAZEBO_MSG_INCLUDE_DIRS}) file(GLOB msgs msgs/*.proto) catkin_package( - INCLUDE_DIRS + INCLUDE_DIRS include ${CMAKE_CURRENT_BINARY_DIR} # for generated messages ${GAZEBO_MSG_INCLUDE_DIRS} - LIBRARIES + LIBRARIES + dave_gazebo_world_plugins_msgs dave_ocean_current_world_plugin - CATKIN_DEPENDS - gazebo_dev - gazebo_msgs + CATKIN_DEPENDS + gazebo_dev + gazebo_msgs gazebo_ros roscpp ) From 38f2b39335698541ef494b2c374b1903eae441e4 Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Tue, 25 Jan 2022 23:42:48 -0500 Subject: [PATCH 3/8] export build/ for protobuf include, instead of build/pkg_name, to be consistent between --install and --no-install (#182) Signed-off-by: Mabel Zhang --- gazebo/dave_gazebo_world_plugins/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gazebo/dave_gazebo_world_plugins/CMakeLists.txt b/gazebo/dave_gazebo_world_plugins/CMakeLists.txt index 070632c2..2073a8e5 100644 --- a/gazebo/dave_gazebo_world_plugins/CMakeLists.txt +++ b/gazebo/dave_gazebo_world_plugins/CMakeLists.txt @@ -46,7 +46,10 @@ file(GLOB msgs msgs/*.proto) catkin_package( INCLUDE_DIRS include - ${CMAKE_CURRENT_BINARY_DIR} # for generated messages + # for generated Protobuf messages. Export parent dir (build/), so that + # the #include <*.pb.h> line has the package name, consistent between + # catkin config --install and --no-install. + ${CMAKE_CURRENT_BINARY_DIR}/.. ${GAZEBO_MSG_INCLUDE_DIRS} LIBRARIES dave_gazebo_world_plugins_msgs From 4ca4969f9a4af14887c6f06b2d7b50f2ce174f39 Mon Sep 17 00:00:00 2001 From: Mabel Zhang Date: Wed, 26 Jan 2022 16:18:08 -0500 Subject: [PATCH 4/8] fix typos, install models (#183) Signed-off-by: Mabel Zhang --- examples/dave_demo_launch/CMakeLists.txt | 33 +----------------------- examples/dave_demo_launch/package.xml | 2 +- models/dave_object_models/CMakeLists.txt | 5 ++++ models/dave_robot_models/CMakeLists.txt | 5 ++++ models/dave_sensor_models/CMakeLists.txt | 5 ++++ models/dave_sensor_models/package.xml | 2 +- 6 files changed, 18 insertions(+), 34 deletions(-) diff --git a/examples/dave_demo_launch/CMakeLists.txt b/examples/dave_demo_launch/CMakeLists.txt index 030bc4ab..f4fd25e5 100644 --- a/examples/dave_demo_launch/CMakeLists.txt +++ b/examples/dave_demo_launch/CMakeLists.txt @@ -1,42 +1,11 @@ cmake_minimum_required(VERSION 3.1.1) project(dave_demo_launch) -find_package(catkin REQUIRED) - -if(NOT "${CMAKE_VERSION}" VERSION_LESS "3.16") - set(CMAKE_CXX_STANDARD 17) - set(CMAKE_CXX_STANDARD_REQUIRED ON) -else() - add_compile_options(-std=c++11) -endif() find_package(catkin REQUIRED COMPONENTS) -find_package(gazebo REQUIRED) -find_package(roscpp REQUIRED) -find_package(std_msgs REQUIRED) - -include_directories(${roscpp_INCLUDE_DIRS}) -include_directories(${std_msgs_INCLUDE_DIRS}) -include_directories( - include - ${catkin_INCLUDE_DIRS} - ${GAZEBO_INCLUDE_DIRS} -) -link_directories(${GAZEBO_LIBRARY_DIRS}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}") -set(SENSOR_ROS_PLUGINS_LIST "") - -catkin_package( - INCLUDE_DIRS - LIBRARIES - CATKIN_DEPENDS - ) +catkin_package() # for launch install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} PATTERN "*~" EXCLUDE) - -# for Python scripts -catkin_install_python(PROGRAMS - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) diff --git a/examples/dave_demo_launch/package.xml b/examples/dave_demo_launch/package.xml index a9654a23..1baa4f77 100644 --- a/examples/dave_demo_launch/package.xml +++ b/examples/dave_demo_launch/package.xml @@ -5,7 +5,7 @@ The dave_demo_launch package contains launch files for DAVE project demos dtd Apache2 - dtd --> + dtd catkin diff --git a/models/dave_object_models/CMakeLists.txt b/models/dave_object_models/CMakeLists.txt index 86520d74..019f17a3 100644 --- a/models/dave_object_models/CMakeLists.txt +++ b/models/dave_object_models/CMakeLists.txt @@ -10,3 +10,8 @@ endif() find_package(catkin REQUIRED COMPONENTS) +catkin_package() + +install(DIRECTORY models + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + PATTERN "*~" EXCLUDE) diff --git a/models/dave_robot_models/CMakeLists.txt b/models/dave_robot_models/CMakeLists.txt index 4cae1e4a..67e1ed8a 100644 --- a/models/dave_robot_models/CMakeLists.txt +++ b/models/dave_robot_models/CMakeLists.txt @@ -13,3 +13,8 @@ find_package(catkin REQUIRED COMPONENTS uuv_sensor_ros_plugins ds_sim) +catkin_package() + +install(DIRECTORY models + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + PATTERN "*~" EXCLUDE) diff --git a/models/dave_sensor_models/CMakeLists.txt b/models/dave_sensor_models/CMakeLists.txt index 12edb113..2df1f73e 100644 --- a/models/dave_sensor_models/CMakeLists.txt +++ b/models/dave_sensor_models/CMakeLists.txt @@ -13,3 +13,8 @@ find_package(catkin REQUIRED COMPONENTS uuv_sensor_ros_plugins ds_sim) +catkin_package() + +install(DIRECTORY models + DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} + PATTERN "*~" EXCLUDE) diff --git a/models/dave_sensor_models/package.xml b/models/dave_sensor_models/package.xml index f7237ddc..662b8396 100644 --- a/models/dave_sensor_models/package.xml +++ b/models/dave_sensor_models/package.xml @@ -9,7 +9,7 @@ catkin - gazebo_ross + gazebo_ros uuv_sensor_ros_plugins ds_sim From a1fc6f3d51249fd1612cda2a0b36342ccbc4e0dc Mon Sep 17 00:00:00 2001 From: Woensug Choi Date: Thu, 10 Feb 2022 19:32:39 +0900 Subject: [PATCH 5/8] search everywhere for csv file --- .../src/ocean_current_world_plugin.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc b/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc index 8fa228bf..8515ef5c 100644 --- a/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc +++ b/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc @@ -319,18 +319,7 @@ void UnderwaterCurrentPlugin::LoadStratifiedCurrentDatabase() transientCurrentParams->Get("databasefilePath"); else { - // Using boost: - // boost::filesystem::path - // concatPath(boost::filesystem::initial_path().parent_path()); - // concatPath += - // ("/uuv_ws/src/dave/models/dave_worlds/" + - // "worlds/transientOceanCurrentDatabase.csv"); - // this->databaseFilePath = concatPath.generic_string(); - // - // Use ros package path: - - this->databaseFilePath = ros::package::getPath("dave_worlds") + - "/worlds/transientOceanCurrentDatabase.csv"; + this->databaseFilePath = "transientOceanCurrentDatabase.csv"; } GZ_ASSERT(!this->databaseFilePath.empty(), @@ -350,8 +339,9 @@ void UnderwaterCurrentPlugin::LoadStratifiedCurrentDatabase() csvFile.open(this->databaseFilePath); if (!csvFile) { - this->databaseFilePath = ros::package::getPath("dave_worlds") + - "/worlds/" + this->databaseFilePath; + common::SystemPaths *paths = common::SystemPaths::Instance(); + this->databaseFilePath = + paths->FindFile(this->databaseFilePath, true); csvFile.open(this->databaseFilePath); } GZ_ASSERT(csvFile, "Stratified Ocean database file does not exist"); From 0873f8163ab21e4e3564db4d1524259a407a49f1 Mon Sep 17 00:00:00 2001 From: Woensug Choi Date: Thu, 10 Feb 2022 19:44:06 +0900 Subject: [PATCH 6/8] search everywhere for db file --- .../src/ocean_current_world_plugin.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc b/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc index 8515ef5c..cedf1234 100644 --- a/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc +++ b/gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc @@ -529,8 +529,9 @@ void UnderwaterCurrentPlugin::LoadTidalOscillationDatabase() csvFile.open(this->tidalFilePath); if (!csvFile) { - this->tidalFilePath = ros::package::getPath("dave_worlds") + - "/worlds/" + this->tidalFilePath; + common::SystemPaths *paths = common::SystemPaths::Instance(); + this->tidalFilePath = + paths->FindFile(this->tidalFilePath, true); csvFile.open(this->tidalFilePath); } GZ_ASSERT(csvFile, "Tidal Oscillation database file does not exist"); From c846ecbc5455fbb1e224e79730c3c1639d891040 Mon Sep 17 00:00:00 2001 From: Woensug Choi Date: Thu, 10 Feb 2022 20:22:43 +0900 Subject: [PATCH 7/8] add dave_world/worlds in gazebo_media_path --- models/dave_worlds/package.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/models/dave_worlds/package.xml b/models/dave_worlds/package.xml index f4a89b26..8eb7f465 100644 --- a/models/dave_worlds/package.xml +++ b/models/dave_worlds/package.xml @@ -14,6 +14,7 @@ ds_sim + From ce09aeef909fa80f4b26d9d7d30b260382bfcc3a Mon Sep 17 00:00:00 2001 From: Woensug Choi Date: Tue, 18 Jan 2022 19:32:18 +0900 Subject: [PATCH 8/8] flag for how many tiles to keep --- .../dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc b/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc index 0b8a4a5b..d06d6ee0 100644 --- a/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc +++ b/gazebo/dave_gazebo_world_plugins/src/bathymetry_world_plugin.cc @@ -43,6 +43,7 @@ struct bathy_grid_t { std::string prefix; int priority; + int tiles_to_keep; // lower-left-hand-corner. double anchor_lat; @@ -91,6 +92,7 @@ namespace gazebo bg->prefix = gridSDF->Get("prefix"); bg->priority = gridSDF->Get("priority"); + bg->tiles_to_keep = gridSDF->Get("tiles_to_keep"); bg->anchor_lat = gridSDF->Get("anchor_lat"); bg->anchor_lon = gridSDF->Get("anchor_lon"); bg->spacing_lat = gridSDF->Get("spacing_lat"); @@ -434,7 +436,7 @@ namespace gazebo } // Perform delayed removal - if (delayRemoveList.size() >= 1) + if (delayRemoveList.size() >= this->bathy_grids[nn]->tiles_to_keep) { std::string modelnamestr = delayRemoveList.front(); delayRemoveList.erase(delayRemoveList.begin());