Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: support Gazebo Harmonic and Garden #42

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions ardupilot_gz_gazebo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,33 @@ project(ardupilot_gz_gazebo)
# Find dependencies.
find_package(ament_cmake REQUIRED)

# --------------------------------------------------------------------------- #
# Find gz-sim and dependencies.

find_package(gz-cmake3 REQUIRED)
set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR})

find_package(gz-plugin2 REQUIRED COMPONENTS register)
set(GZ_PLUGIN_VER ${gz-plugin2_VERSION_MAJOR})

find_package(gz-common5 REQUIRED COMPONENTS profiler)
set(GZ_COMMON_VER ${gz-common5_VERSION_MAJOR})

find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
# Garden (default)
if("$ENV{GZ_VERSION}" STREQUAL "garden" OR NOT DEFINED "ENV{GZ_VERSION}")
gz_find_package(gz-sim7 REQUIRED)
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Garden")
# Harmonic
elseif("$ENV{GZ_VERSION}" STREQUAL "harmonic")
gz_find_package(gz-sim8 REQUIRED)
set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR})

message(STATUS "Compiling against Gazebo Harmonic")
else()
message(FATAL_ERROR "Unsupported GZ_VERSION: $ENV{GZ_VERSION}")
endif()

# --------------------------------------------------------------------------- #
# Build.
Expand Down
11 changes: 11 additions & 0 deletions ardupilot_gz_gazebo/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
<maintainer email="[email protected]">Rhys Mainwaring</maintainer>
<license>GPL-3.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>

<depend>gz-common5</depend>
<depend>gz-cmake3</depend>
<depend>gz-plugin2</depend>

<!-- Garden (default) -->
<depend condition="$GZ_VERSION == garden">gz-sim7</depend>
<depend condition="$GZ_VERSION == ''">gz-sim7</depend>
<!-- Harmonic -->
<depend condition="$GZ_VERSION == harmonic">gz-sim8</depend>

<test_depend>ament_lint_auto</test_depend>
<!-- <test_depend>ament_lint_common</test_depend> -->
<!-- <test_depend>ament_cmake_clang_format</test_depend> -->
Expand Down