From 44e30c1d5d502eed5f0154cff227ca58576b236a Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 9 Apr 2024 10:02:06 +0200 Subject: [PATCH 1/7] Enable ROBOTOLOGY_USES_GZ in CI and improve documentation --- .ci/all-options-enabled-cache.cmake | 2 +- .ci/initial-cache.gh.cmake | 2 +- .ci/install_debian.sh | 19 ++++++++++++++----- .github/workflows/ci.yml | 8 ++++---- doc/cmake-options.md | 7 +++++++ 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.ci/all-options-enabled-cache.cmake b/.ci/all-options-enabled-cache.cmake index 6b89527eb..0856b315a 100644 --- a/.ci/all-options-enabled-cache.cmake +++ b/.ci/all-options-enabled-cache.cmake @@ -1,6 +1,6 @@ # Dependencies options set(ROBOTOLOGY_USES_GAZEBO ON CACHE BOOL "") -set(ROBOTOLOGY_USES_GZ OFF CACHE BOOL "") +set(ROBOTOLOGY_USES_GZ ON CACHE BOOL "") set(ROBOTOLOGY_USES_PCL_AND_VTK ON CACHE BOOL "") set(ROBOTOLOGY_USES_OCTAVE ON CACHE BOOL "") set(ROBOTOLOGY_USES_PYTHON ON CACHE BOOL "") diff --git a/.ci/initial-cache.gh.cmake b/.ci/initial-cache.gh.cmake index 32d1e692f..4268c4d80 100644 --- a/.ci/initial-cache.gh.cmake +++ b/.ci/initial-cache.gh.cmake @@ -1,6 +1,6 @@ # Dependencies options set(ROBOTOLOGY_USES_GAZEBO ON CACHE BOOL "") -set(ROBOTOLOGY_USES_GZ OFF CACHE BOOL "") +set(ROBOTOLOGY_USES_GZ ON CACHE BOOL "") # ROBOTOLOGY_USES_MUJOCO is not really used as of January 2024 set(ROBOTOLOGY_USES_MUJOCO OFF CACHE BOOL "") set(ROBOTOLOGY_USES_PCL_AND_VTK ON CACHE BOOL "") diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh index 3f695f5ee..d56be774b 100755 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -21,23 +21,32 @@ source ${SCRIPT_DIR}/../scripts/install_apt_python_dependencies.sh # Octave apt-get install -y liboctave-dev -# Gazebo Classic lsb_dist="$(. /etc/os-release && echo "$ID")" dist_version="$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//)" echo "lsb_dist: ${lsb_dist}" echo "dist_version: ${dist_version}" + +# We enable osrf's gazebo binaries +mkdir -p /etc/apt/sources.list.d +echo deb http://packages.osrfoundation.org/gazebo/$lsb_dist\-stable $dist_version main > /etc/apt/sources.list.d/gazebo-stable.list +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 +apt-get update + +# Gazebo Classic + # Just a limited amount of distros are supported by OSRF repos, for all the other we use the # gazebo packages in regular repos if [[ ("focal" == "$dist_version" || "buster" == "$dist_version") ]]; then - mkdir -p /etc/apt/sources.list.d - echo deb http://packages.osrfoundation.org/gazebo/$lsb_dist\-stable $dist_version main > /etc/apt/sources.list.d/gazebo-stable.list - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 - apt-get update apt-get install -y libgazebo11-dev else apt-get install -y libgazebo-dev fi +# gz-sim8 binaries are only available for jammy (Ubuntu 20.04) and noble (Ubuntu 22.04) +if [[ ("jammy" == "$dist_version" || "noble" == "$dist_version") ]]; then + apt-get install -y gz-harmonic +fi + # PCL and VTK apt-get install -y libpcl-dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a890728d..5c1c0f9e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,7 +97,7 @@ jobs: shell: bash -l {0} run: | # Dependencies - mamba install asio assimp boost eigen freetype gazebo glew glfw glm graphviz gsl ipopt irrlicht libjpeg-turbo libmatio libode libxml2 nlohmann_json pcl vtk opencv portaudio qt-main sdl sdl2 sqlite tinyxml spdlog lua soxr cmake compilers make ninja pkg-config tomlplusplus libzlib ffmpeg onnxruntime-cpp + mamba install asio assimp boost eigen freetype gazebo gz-sim8 glew glfw glm graphviz gsl ipopt irrlicht libjpeg-turbo libmatio libode libxml2 nlohmann_json pcl vtk opencv portaudio qt-main sdl sdl2 sqlite tinyxml spdlog lua soxr cmake compilers make ninja pkg-config tomlplusplus libzlib ffmpeg onnxruntime-cpp # Python mamba install python numpy swig==4.1.0 pybind11 pyqt matplotlib h5py tornado u-msgpack-python pyzmq ipython gst-plugins-good gst-plugins-bad pyqtwebengine qtpy pyyaml @@ -244,11 +244,11 @@ jobs: cd build cmake -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -G"${{ matrix.cmake_generator }}" -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.project_tags_cmake_options }} .. - - name: Disable profiles that are not supported in docker for now [Docker debian-testing and debian-buster] + - name: Disable profiles that are not supported in Debian [Docker debian-testing and debian-buster] if: (matrix.docker_image == 'debian:testing' || matrix.docker_image == 'debian:buster-backports') run: | cd build - cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF . + cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - name: Disable MuJoCo for other distros released before 2022 [Docker ubuntu:focal and debian:bullseye] if: (matrix.docker_image == 'ubuntu:focal' || matrix.docker_image == 'debian:bullseye') @@ -401,7 +401,7 @@ jobs: run: | cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} cd build - cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF . + cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - name: Build [Ubuntu] if: contains(matrix.os, 'ubuntu') diff --git a/doc/cmake-options.md b/doc/cmake-options.md index 4eb68e835..4923f2048 100644 --- a/doc/cmake-options.md +++ b/doc/cmake-options.md @@ -104,8 +104,10 @@ Not all options are supported on all platforms. The following table provides a r 1!:`ROBOTOLOGY_USES_MUJOCO` does not support building with apt dependencies on Debian or Ubuntu distributions older than 2022. Furthermore, it does not support build on Windows with Visual Studio 2019, it requires Visual Studio 2022. + 2!:`ROBOTOLOGY_ENABLE_ROBOT_TESTING` and `ROBOTOLOGY_ENABLE_ICUB_HEAD` do not support building with conda-forge dependencies on Apple Silicon. +3!:`ROBOTOLOGY_USES_GZ_SIM` do not support building on Debian distros (only Ubuntu is supported). Furthermore it does not run on Windows (https://github.com/gazebosim/gz-sim/issues/2089) and have known problems on macOS (https://github.com/robotology/gz-sim-yarp-plugins/issues/90). Profile-specific documentation @@ -206,6 +208,11 @@ Follow the steps in https://github.com/robotology/icub-models#use-the-models-wi Support for this dependency is enabled by the `ROBOTOLOGY_USES_GZ_SIM` CMake option, that enables the software that depends on "Modern Gazebo" (gz-sim). +> [!IMPORTANT] +> At the moment the `ROBOTOLOGY_USES_GZ_SIM` does not run on Windows (https://github.com/gazebosim/gz-sim/issues/2089) and have known problems on macOS (https://github.com/robotology/gz-sim-yarp-plugins/issues/90). Furthermore, it is not supported on non-Ubuntu Debian distributions with apt dependencies. + + + ## MuJoCo Support for this dependency is enabled by the `ROBOTOLOGY_USES_MUJOCO` CMake option, that enables the software that depends on MuJoCo. Note that differently from other `ROBOTOLOGY_USES_<..>` options, in this case the main dependency (MuJoCo) is compiled by the superbuild. From 57a611bc13652e271ebded696c2bf25c4815a70b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 9 Apr 2024 10:16:46 +0200 Subject: [PATCH 2/7] Update install_debian.sh --- .ci/install_debian.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh index d56be774b..a1c935166 100755 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -26,11 +26,13 @@ dist_version="$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//)" echo "lsb_dist: ${lsb_dist}" echo "dist_version: ${dist_version}" -# We enable osrf's gazebo binaries -mkdir -p /etc/apt/sources.list.d -echo deb http://packages.osrfoundation.org/gazebo/$lsb_dist\-stable $dist_version main > /etc/apt/sources.list.d/gazebo-stable.list -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 -apt-get update +# We enable osrf's gazebo binaries only on Ubuntu +if [[ ("ubuntu" == "$lsb_dist") ]]; then + mkdir -p /etc/apt/sources.list.d + echo deb http://packages.osrfoundation.org/gazebo/$lsb_dist\-stable $dist_version main > /etc/apt/sources.list.d/gazebo-stable.list + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 + apt-get update +fi # Gazebo Classic From 83086792a1bde127831e0e8d7034e90b76299ce9 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 9 Apr 2024 14:47:38 +0200 Subject: [PATCH 3/7] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c1c0f9e9..823aa1798 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -250,11 +250,11 @@ jobs: cd build cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - - name: Disable MuJoCo for other distros released before 2022 [Docker ubuntu:focal and debian:bullseye] + - name: Disable MuJoCo and gz-sim for distros released before 2022 [Docker ubuntu:focal and debian:bullseye] if: (matrix.docker_image == 'ubuntu:focal' || matrix.docker_image == 'debian:bullseye') run: | cd build - cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF . + cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - name: Build [Docker] run: | From 61410c5c823b86eb1e778b1ddb486cdeffb8bf15 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 8 May 2024 14:43:48 +0200 Subject: [PATCH 4/7] Update install_debian.sh --- .ci/install_debian.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh index b780f01f6..d6011d184 100755 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -23,6 +23,13 @@ dist_version="$(lsb_release -c | cut -d: -f2 | sed s/'^\t'//)" echo "lsb_dist: ${lsb_dist}" echo "dist_version: ${dist_version}" +# Octave +if [[ ("focal" == "$dist_version" || "buster" == "$dist_version" || "bullseye" == "$dist_version") ]]; then + apt-get install -y liboctave-dev +else + apt-get install -y octave-dev +fi + # We enable osrf's gazebo binaries only on Ubuntu if [[ ("ubuntu" == "$lsb_dist") ]]; then mkdir -p /etc/apt/sources.list.d From 56b3c0171b8ea0ba973ee5de988acefbafb760d5 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 8 May 2024 14:49:29 +0200 Subject: [PATCH 5/7] Update install_debian.sh --- .ci/install_debian.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh index d6011d184..600619a4d 100755 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -52,8 +52,8 @@ else apt-get install -y libgazebo-dev fi -# gz-sim8 binaries are only available for jammy (Ubuntu 20.04) and noble (Ubuntu 22.04) -if [[ ("jammy" == "$dist_version" || "noble" == "$dist_version") ]]; then +# gz-sim8 binaries are only available for jammy (Ubuntu 22.04) +if [[ ("jammy" == "$dist_version") ]]; then apt-get install -y gz-harmonic fi From 2bbfab56187c78a7f6505def199d6e6c050bfa21 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 8 May 2024 14:50:10 +0200 Subject: [PATCH 6/7] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98707bea2..fe745e2d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,7 +261,7 @@ jobs: if: (matrix.docker_image == 'ubuntu:24.04') run: | cd build - cmake -DROBOTOLOGY_USES_GAZEBO:BOOL=OFF . + cmake -DROBOTOLOGY_USES_GAZEBO:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - name: Build [Docker] run: | From 43814e19fd5e30ed32f4ce4ae61311f00b55f249 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 9 May 2024 17:05:07 +0200 Subject: [PATCH 7/7] Apply suggestions from code review Co-authored-by: Alessandro Croci <57228872+xela-95@users.noreply.github.com> --- doc/cmake-options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/cmake-options.md b/doc/cmake-options.md index 42d5087e1..54a261bef 100644 --- a/doc/cmake-options.md +++ b/doc/cmake-options.md @@ -106,7 +106,9 @@ Not all options are supported on all platforms. The following table provides a r 1!:`ROBOTOLOGY_USES_MUJOCO` does not support building with apt dependencies on Debian or Ubuntu distributions older than 2022. Furthermore, it does not support build on Windows with Visual Studio 2019, it requires Visual Studio 2022. 2!:`ROBOTOLOGY_ENABLE_ROBOT_TESTING` and `ROBOTOLOGY_ENABLE_ICUB_HEAD` do not support building with conda-forge dependencies on Apple Silicon. + 3!:`ROBOTOLOGY_USES_GZ_SIM` with apt dependencies do not support building on Debian distros (only Ubuntu is supported). At the moment Ubuntu 24.04 apt packages are not available (https://github.com/gazebosim/gz-sim/issues/2390#issuecomment-2096728527). Furthermore it does not run on Windows (https://github.com/gazebosim/gz-sim/issues/2089) and have known problems on macOS (https://github.com/robotology/gz-sim-yarp-plugins/issues/90). + 4!:`ROBOTOLOGY_USES_OCTAVE` do not support building with apt dependencies on Ubuntu 20.04.