From b5d6c4175098af96019056e4fcfa522f98dc784b Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Sat, 27 Apr 2024 12:30:51 -0600 Subject: [PATCH 1/2] Default to gazebo harmonic Signed-off-by: Ryan Friedman --- CMakeLists.txt | 4 ++-- README.md | 18 ++++++++++++++++-- package.xml | 8 ++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dd9a22..b9744ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # Find gz-sim and dependencies. # Harmonic -if("$ENV{GZ_VERSION}" STREQUAL "harmonic") +if("$ENV{GZ_VERSION}" STREQUAL "harmonic" OR NOT DEFINED "ENV{GZ_VERSION}") find_package(gz-cmake3 REQUIRED) set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR}) @@ -33,7 +33,7 @@ if("$ENV{GZ_VERSION}" STREQUAL "harmonic") message(STATUS "Compiling against Gazebo Harmonic") # Garden (default) -elseif("$ENV{GZ_VERSION}" STREQUAL "garden" OR NOT DEFINED "ENV{GZ_VERSION}") +elseif("$ENV{GZ_VERSION}" STREQUAL "garden") find_package(gz-cmake3 REQUIRED) set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR}) diff --git a/README.md b/README.md index 4ab25bd..ca92be3 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ The project comprises a Gazebo plugin to connect to ArduPilot SITL ## Prerequisites Gazebo Garden or Harmonic is supported on Ubuntu 22.04 (Jammy). +Harmonic is recommended. If you are running Ubuntu as a virtual machine you will need at least Ubuntu 20.04 in order to have the OpenGL support required for the `ogre2` render engine. Gazebo and ArduPilot SITL will also run on macOS @@ -43,14 +44,27 @@ Install additional dependencies: ### Ubuntu -Gazebo Garden: +Recommended - Use rosdep with +[osrf's rosdep rules](https://github.com/osrf/osrf-rosdep?tab=readme-ov-file#1-use-rosdep-to-resolve-gazebo-libraries) +to manage all dependencies. This is driven off of the environment variable `GZ_VERSION`. + +```bash +export GZ_VERSION=harmonic # or garden +sudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list' +rosdep update +rosdep resolve gz-harmonic +# Navigate to your ROS workspace before the next command. +rosdep install --from-paths src --ignore-src -y +``` + +Manual - Gazebo Garden Dependencies: ```bash sudo apt update sudo apt install libgz-sim7-dev rapidjson-dev ``` -Or Gazebo Harmonic: +Manual - Gazebo Harmonic Dependencies: ```bash sudo apt update diff --git a/package.xml b/package.xml index c6a1b69..1e67aee 100644 --- a/package.xml +++ b/package.xml @@ -12,14 +12,14 @@ rapidjson-dev - + gz-cmake3 gz-sim8 - + gz-cmake3 + gz-sim8 + gz-cmake3 gz-sim7 - gz-cmake3 - gz-sim7 ament_lint_auto From 2cbf8dffaa0bed2409133e365f6d3ec9851d22f8 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Tue, 7 May 2024 10:28:48 -0600 Subject: [PATCH 2/2] Change defaults, have rosdep instructions last Signed-off-by: Ryan Friedman --- CMakeLists.txt | 4 ++-- README.md | 30 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b9744ab..0278b07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # --------------------------------------------------------------------------- # # Find gz-sim and dependencies. -# Harmonic +# Harmonic (default) if("$ENV{GZ_VERSION}" STREQUAL "harmonic" OR NOT DEFINED "ENV{GZ_VERSION}") find_package(gz-cmake3 REQUIRED) set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR}) @@ -32,7 +32,7 @@ if("$ENV{GZ_VERSION}" STREQUAL "harmonic" OR NOT DEFINED "ENV{GZ_VERSION}") set(GZ_SIM_VER ${gz-sim8_VERSION_MAJOR}) message(STATUS "Compiling against Gazebo Harmonic") -# Garden (default) +# Garden elseif("$ENV{GZ_VERSION}" STREQUAL "garden") find_package(gz-cmake3 REQUIRED) set(GZ_CMAKE_VER ${gz-cmake3_VERSION_MAJOR}) diff --git a/README.md b/README.md index ca92be3..db0649b 100644 --- a/README.md +++ b/README.md @@ -44,18 +44,7 @@ Install additional dependencies: ### Ubuntu -Recommended - Use rosdep with -[osrf's rosdep rules](https://github.com/osrf/osrf-rosdep?tab=readme-ov-file#1-use-rosdep-to-resolve-gazebo-libraries) -to manage all dependencies. This is driven off of the environment variable `GZ_VERSION`. - -```bash -export GZ_VERSION=harmonic # or garden -sudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list' -rosdep update -rosdep resolve gz-harmonic -# Navigate to your ROS workspace before the next command. -rosdep install --from-paths src --ignore-src -y -``` +#### Garden (apt) Manual - Gazebo Garden Dependencies: @@ -64,6 +53,8 @@ sudo apt update sudo apt install libgz-sim7-dev rapidjson-dev ``` +#### Harmonic (apt) + Manual - Gazebo Harmonic Dependencies: ```bash @@ -71,6 +62,21 @@ sudo apt update sudo apt install libgz-sim8-dev rapidjson-dev ``` +#### Rosdep + +Use rosdep with +[osrf's rosdep rules](https://github.com/osrf/osrf-rosdep?tab=readme-ov-file#1-use-rosdep-to-resolve-gazebo-libraries) +to manage all dependencies. This is driven off of the environment variable `GZ_VERSION`. + +```bash +export GZ_VERSION=harmonic # or garden +sudo bash -c 'wget https://raw.githubusercontent.com/osrf/osrf-rosdep/master/gz/00-gazebo.list -O /etc/ros/rosdep/sources.list.d/00-gazebo.list' +rosdep update +rosdep resolve gz-harmonic # or gz-garden +# Navigate to your ROS workspace before the next command. +rosdep install --from-paths src --ignore-src -y +``` + ### macOS ```bash