Skip to content
Merged
33 changes: 1 addition & 32 deletions examples/dave_demo_launch/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
2 changes: 1 addition & 1 deletion examples/dave_demo_launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<description>The dave_demo_launch package contains launch files for DAVE project demos</description>
<maintainer email="dtdavi1@nps.edu">dtd</maintainer>
<license>Apache2</license>
<author email="dtdavi1@nps.edu">dtd</author> -->
<author email="dtdavi1@nps.edu">dtd</author>
<buildtool_depend>catkin</buildtool_depend>
<export>
<!-- Other tools can request additional information be placed here -->
Expand Down
16 changes: 10 additions & 6 deletions gazebo/dave_gazebo_world_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ 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
# 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
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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct bathy_grid_t
{
std::string prefix;
int priority;
int tiles_to_keep;

// lower-left-hand-corner.
double anchor_lat;
Expand Down Expand Up @@ -91,6 +92,7 @@ namespace gazebo

bg->prefix = gridSDF->Get<std::string>("prefix");
bg->priority = gridSDF->Get<int>("priority");
bg->tiles_to_keep = gridSDF->Get<int>("tiles_to_keep");
bg->anchor_lat = gridSDF->Get<double>("anchor_lat");
bg->anchor_lon = gridSDF->Get<double>("anchor_lon");
bg->spacing_lat = gridSDF->Get<double>("spacing_lat");
Expand Down Expand Up @@ -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());
Expand Down
23 changes: 7 additions & 16 deletions gazebo/dave_gazebo_world_plugins/src/ocean_current_world_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,7 @@ void UnderwaterCurrentPlugin::LoadStratifiedCurrentDatabase()
transientCurrentParams->Get<std::string>("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(),
Expand All @@ -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");
Expand Down Expand Up @@ -539,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");
Expand Down
5 changes: 5 additions & 0 deletions models/dave_object_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ endif()

find_package(catkin REQUIRED COMPONENTS)

catkin_package()

install(DIRECTORY models
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
PATTERN "*~" EXCLUDE)
5 changes: 5 additions & 0 deletions models/dave_robot_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 5 additions & 0 deletions models/dave_sensor_models/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion models/dave_sensor_models/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<buildtool_depend>catkin</buildtool_depend>

<depend>gazebo_ros</depend>s
<depend>gazebo_ros</depend>
<depend>uuv_sensor_ros_plugins</depend>
<depend>ds_sim</depend>
<export>
Expand Down
1 change: 1 addition & 0 deletions models/dave_worlds/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<depend>ds_sim</depend>

<export>
<gazebo_ros gazebo_media_path="${prefix}/worlds"/>
<gazebo_ros gazebo_media_path="${prefix}/media"/>
</export>

Expand Down