From d572b9e261bfca9d3536fc795b5e85cad5528789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Pal=C3=A9ologue?= Date: Mon, 20 Nov 2023 17:46:07 +0100 Subject: [PATCH] Imported upstream version '2.1.0' of 'upstream' --- .github/workflows/foxy_focal.yml | 15 ++++ .github/workflows/galactic_focal.yml | 15 ++++ .github/workflows/humble_jammy.yml | 15 ++++ .github/workflows/iron_jammy.yml | 15 ++++ .github/workflows/ros2.yml | 41 ++++++++++ CHANGELOG.rst | 14 ++++ CMakeLists.txt | 117 +++++++-------------------- README | 16 ---- README.md | 23 ++++++ install_with_auto_mode.sh | 27 +++++++ package.xml | 18 +++-- 11 files changed, 206 insertions(+), 110 deletions(-) create mode 100644 .github/workflows/foxy_focal.yml create mode 100644 .github/workflows/galactic_focal.yml create mode 100644 .github/workflows/humble_jammy.yml create mode 100644 .github/workflows/iron_jammy.yml create mode 100644 .github/workflows/ros2.yml delete mode 100644 README create mode 100644 README.md create mode 100755 install_with_auto_mode.sh diff --git a/.github/workflows/foxy_focal.yml b/.github/workflows/foxy_focal.yml new file mode 100644 index 0000000..5260a12 --- /dev/null +++ b/.github/workflows/foxy_focal.yml @@ -0,0 +1,15 @@ +name: ros2-foxy-focal + +on: + push + +jobs: + ros2_foxy_focal_ci: + name: foxy (focal) + uses: ./.github/workflows/ros2.yml + with: + ROS_DISTRO: foxy + ROS_REPO: testing + OS_NAME: ubuntu + OS_CODE_NAME: focal + ALLOW_FAIL: false \ No newline at end of file diff --git a/.github/workflows/galactic_focal.yml b/.github/workflows/galactic_focal.yml new file mode 100644 index 0000000..39f6e44 --- /dev/null +++ b/.github/workflows/galactic_focal.yml @@ -0,0 +1,15 @@ +name: ros2-galactic-focal + +on: + push + +jobs: + ros2_galactic_focal_ci: + name: galactic (focal) + uses: ./.github/workflows/ros2.yml + with: + ROS_DISTRO: galactic + ROS_REPO: testing + OS_NAME: ubuntu + OS_CODE_NAME: focal + ALLOW_FAIL: false \ No newline at end of file diff --git a/.github/workflows/humble_jammy.yml b/.github/workflows/humble_jammy.yml new file mode 100644 index 0000000..4332206 --- /dev/null +++ b/.github/workflows/humble_jammy.yml @@ -0,0 +1,15 @@ +name: ros2-humble-jammy + +on: + push + +jobs: + ros2_humble_jammy_ci: + name: humble (jammy) + uses: ./.github/workflows/ros2.yml + with: + ROS_DISTRO: humble + ROS_REPO: testing + OS_NAME: ubuntu + OS_CODE_NAME: jammy + ALLOW_FAIL: false \ No newline at end of file diff --git a/.github/workflows/iron_jammy.yml b/.github/workflows/iron_jammy.yml new file mode 100644 index 0000000..b289972 --- /dev/null +++ b/.github/workflows/iron_jammy.yml @@ -0,0 +1,15 @@ +name: ros2-iron-jammy + +on: + push + +jobs: + ros2_iron_jammy_ci: + name: iron (jammy) + uses: ./.github/workflows/ros2.yml + with: + ROS_DISTRO: iron + ROS_REPO: testing + OS_NAME: ubuntu + OS_CODE_NAME: jammy + ALLOW_FAIL: false diff --git a/.github/workflows/ros2.yml b/.github/workflows/ros2.yml new file mode 100644 index 0000000..dfba116 --- /dev/null +++ b/.github/workflows/ros2.yml @@ -0,0 +1,41 @@ +name: ros2 + +on: + workflow_call: + inputs: + ROS_DISTRO: + required: true + type: string + ROS_REPO: + required: true + type: string + OS_NAME: + required: true + type: string + OS_CODE_NAME: + required: true + type: string + ALLOW_FAIL: + required: true + type: boolean + +jobs: + ros2_ci: + name: ROS2 + runs-on: ubuntu-latest + continue-on-error: ${{ inputs.ALLOW_FAIL }} + env: + CCACHE_DIR: "${{ github.workspace }}/.ccache" + steps: + - name: Check out the naoqi_driver2 repo + uses: actions/checkout@v2 + - name: Fetch/store directory used by ccache + uses: actions/cache@v2 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-${{ inputs.ROS_DISTRO }}-${{ inputs.ROS_REPO }}-${{github.run_id}} + restore-keys: | + ccache-${{ inputs.ROS_DISTRO }}-${{ inputs.ROS_REPO }}- + - name: Run industrial CI + uses: 'ros-industrial/industrial_ci@master' + env: ${{ inputs }} \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5793013..e1d93b9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,20 @@ Changelog for package nao_meshes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +2.1.0 (2023-11-15) +------------------ +* Workaround running installer in CI +* Fix build on GitHub Actions +* Add CI +* Interactive agreement by default + Explicit option in command line to agree to license. + Improved interaction and messages. +* Update maintainers +* Rename README to README.md +* Fix error in CMakeLists.txt +* Upgrade nao_meshes package for ROS2 +* Contributors: Maxime Busy, Victor Paleologue, Victor Paléologue, mbusy + 0.1.13 (2022-09-07) ------------------- * Update ERROR_FILE to ERROR_FILE_CMD in CMakeLists to avoid build crash diff --git a/CMakeLists.txt b/CMakeLists.txt index 8afe150..a40af7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,110 +1,53 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.5) project(nao_meshes) -find_package(catkin) -catkin_package() +find_package(ament_cmake REQUIRED) # When getting a new binay, the MD5 might change, and the folder hierarchy too # read comments below to adapt -set(TMP_DIR ${CATKIN_DEVEL_PREFIX}/tmp) - -set(INSTALLER_TMP_PATH ${TMP_DIR}/tmp/installer.run) +set(TMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/tmp) +set(INSTALLER_PATH ${TMP_DIR}/installer.run) -# Try to figure out the architecture -string(FIND ${CATKIN_DEVEL_PREFIX} "i686" IS_32) -message(STATUS "Architecture is apparently 32 (-1 for no): ${IS_32}") -if(${IS_32} STREQUAL "-1") -# Trust CMAKE_SYSTEM_PROCESSOR which does not work on the farm -if (${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64") -set(IS_32 FALSE) +if(${CMAKE_HOST_SYSTEM_PROCESSOR} MATCHES "$i.86$") + message(STATUS "Downloading 32-bit installer") + set(INSTALLER_URL "https://github.com/ros-naoqi/nao_meshes_installer/raw/master/naomeshes-0.6.7-linux-installer.run") + set(INSTALLER_MD5 1984b2790930044b4ee00496315c0021) +elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64") + message(STATUS "Downloading 64-bit installer") + set(INSTALLER_URL "https://github.com/ros-naoqi/nao_meshes_installer/raw/master/naomeshes-0.6.7-linux-x64-installer.run") + set(INSTALLER_MD5 5f897a3328f217bae6c0ed2a934e524c) else() -set(IS_32 TRUE) -endif() + message(FATAL_ERROR "Mesh installer is not compatible with your host architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'") endif() -if (NOT ${IS_32}) -message(STATUS "Downloading 64 bit installer") -file(DOWNLOAD -"https://github.com/ros-naoqi/nao_meshes_installer/raw/master/naomeshes-0.6.7-linux-x64-installer.run" - ${INSTALLER_TMP_PATH} SHOW_PROGRESS - INACTIVITY_TIMEOUT 60 - EXPECTED_MD5 5f897a3328f217bae6c0ed2a934e524c -) -else() -message(STATUS "Downloading 32 bit installer") -file(DOWNLOAD -"https://github.com/ros-naoqi/nao_meshes_installer/raw/master/naomeshes-0.6.7-linux-installer.run" - ${INSTALLER_TMP_PATH} SHOW_PROGRESS +file(DOWNLOAD ${INSTALLER_URL} ${INSTALLER_PATH} + SHOW_PROGRESS INACTIVITY_TIMEOUT 60 - EXPECTED_MD5 1984b2790930044b4ee00496315c0021 + EXPECTED_MD5 ${INSTALLER_MD5} ) -endif() # specify the interesting folder in the archive. You might want to change # that for a new binary where the structure is different set(TMP_MESH_PATH ${TMP_DIR}/meshes) set(TMP_TEXTURE_PATH ${TMP_DIR}/texture) -# final path in devel/install space -set(FINAL_MESH_PATH ${CATKIN_GLOBAL_SHARE_DESTINATION}/${PROJECT_NAME}/) - -# make the file executable to install -file(COPY ${INSTALLER_TMP_PATH} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - DESTINATION ${TMP_DIR} -) - -set(INSTALLER_PATH ${TMP_DIR}/installer.run) - -# add a target for devel space -add_custom_target(${PROJECT_NAME}_meshes - COMMAND ${INSTALLER_PATH} --mode text --prefix ${TMP_DIR} - COMMAND mkdir -p ${CATKIN_DEVEL_PREFIX}/${FINAL_MESH_PATH} - COMMAND cp -fr ${TMP_MESH_PATH} ${CATKIN_DEVEL_PREFIX}/${FINAL_MESH_PATH}/ - COMMAND cp -fr ${TMP_TEXTURE_PATH} ${CATKIN_DEVEL_PREFIX}/${FINAL_MESH_PATH}/ - COMMAND rm -fr ${TMP_DIR}/rollback* -) - -# uncompress the meshes during install -install(CODE -" -# uncompress the archive -message(STATUS \"using ${INSTALLER_PATH} to decompress to ${TMP_DIR}\") -execute_process(COMMAND ${INSTALLER_PATH} --mode unattended --prefix ${TMP_DIR} - OUTPUT_VARIABLE OUT - ERROR_VARIABLE ERROR - RESULT_VARIABLE RESULT -) -message(STATUS \"intall out: \${OUT}\") -message(STATUS \"install error: \${ERROR}\") -message(STATUS \"install result: \${RESULT}\") +# Where to install the meshes and textures +# relative to the share folder of the package. +set(INSTALL_DESTINATION_IN_SHARE ${PROJECT_NAME}) -execute_process(COMMAND ls - WORKING_DIRECTORY ${TMP_DIR} - OUTPUT_VARIABLE OUT_LS - ERROR_VARIABLE ERROR_LS - RESULT_VARIABLE RESULT_LS -) -message(STATUS \"ls out: \${OUT_LS}\") -message(STATUS \"ls error: \${ERROR_LS}\") -message(STATUS \"ls result: \${RESULT_LS}\") - -execute_process(COMMAND file ${TMP_DIR}/installer.run - OUTPUT_VARIABLE OUT_FILE - ERROR_VARIABLE ERROR_FILE_CMD - RESULT_VARIABLE ERROR_FILE_CMD -) -message(STATUS \"file out: \${OUT_FILE}\") -message(STATUS \"file error: \${ERROR_FILE_CMD}\") -message(STATUS \"file result: \${RESULT_FILE}\") -" +# install the meshes in the build directory when building +message(STATUS "Unpacking meshes from the installer: \n${INSTALLER_PATH} --prefix ${TMP_DIR}") +add_custom_target(install_meshes ALL + COMMAND chmod +x ${INSTALLER_PATH} + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install_with_auto_mode.sh ${INSTALLER_PATH} --prefix ${TMP_DIR} + BYPRODUCTS ${TMP_MESH_PATH} ${TMP_TEXTURE_PATH} + TERMINAL ) # install the archive -install(DIRECTORY ${TMP_MESH_PATH} - DESTINATION ${FINAL_MESH_PATH}/ -) -install(DIRECTORY ${TMP_TEXTURE_PATH} - DESTINATION ${FINAL_MESH_PATH}/ +install(DIRECTORY ${TMP_MESH_PATH} ${TMP_TEXTURE_PATH} + DESTINATION share/${PROJECT_NAME} ) + +ament_package() diff --git a/README b/README deleted file mode 100644 index b73cce2..0000000 --- a/README +++ /dev/null @@ -1,16 +0,0 @@ -This package allows you to install the Aldebaran NAO meshes. -In devel space, you have to type: - - make nao_meshes_meshes - -When building a binary package, please make sure that with the installer the user has to agree to -Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License -that is given in the LICENSE file: this is the only requirement from Aldebaran. - -Justification: in French law, only clicking/entering text is recognized as a virtual signature; -the LICENSE file is therefore not sufficient. Aldebaran allows you to redistribute those -meshes as long as they are given through an installer that asks the user to click/enter "ok/yes". - - -Also, the history of that repo will be frequently re-written ! we don't want to keep the old history -of the meshes as this could result in heavy cloning. diff --git a/README.md b/README.md new file mode 100644 index 0000000..947b14f --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# nao_meshes2 + +This package allows you to install the Aldebaran Pepper meshes for ROS2 + +When building a binary package, please make sure that with the installer the user has to agree to +Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License +that is given in the LICENSE file: this is the only requirement from Aldebaran. + +Justification: in French law, only clicking/entering text is recognized as a virtual signature; +the LICENSE file is therefore not sufficient. Aldebaran allows you to redistribute those +meshes as long as they are given through an installer that asks the user to click/enter "ok/yes". + + +Also, the history of that repo will be frequently re-written ! we don't want to keep the old history +of the meshes as this could result in heavy cloning. + +## Status + +ROS Distro | Binary Status | Source status | +|-------------------|-------------------|-------------------| +Humble | | +Galactic | [![Build Status](https://build.ros2.org/job/Gbin_uF64__nao_meshes__ubuntu_focal_amd64__binary/badge/icon)](https://build.ros2.org/job/Gbin_uF64__nao_meshes__ubuntu_focal_amd64__binary/) | [![Build Status](https://build.ros2.org/job/Gsrc_uF__nao_meshes__ubuntu_focal__source/badge/icon)](https://build.ros2.org/job/Gsrc_uF__nao_meshes__ubuntu_focal__source/) +Foxy | [![Build Status](https://build.ros2.org/job/Fbin_uF64__nao_meshes__ubuntu_focal_amd64__binary/badge/icon)](https://build.ros2.org/job/Fbin_uF64__nao_meshes__ubuntu_focal_amd64__binary/) | [![Build Status](https://build.ros2.org/job/Fsrc_uF__nao_meshes__ubuntu_focal__source/badge/icon)](https://build.ros2.org/job/Fsrc_uF__nao_meshes__ubuntu_focal__source/) diff --git a/install_with_auto_mode.sh b/install_with_auto_mode.sh new file mode 100755 index 0000000..dd0c5be --- /dev/null +++ b/install_with_auto_mode.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -e + +# Installer should show up to the user if it is not an automated job. +if [ -n "$DEBIAN_FRONTEND" ]; then + if [ "$DEBIAN_FRONTEND" = "noninteractive" ]; then + INSTALL_MODE_FLAG=("--mode" "unattended") + elif [ "$DEBIAN_FRONTEND" = "readline" ]; then + INSTALL_MODE_FLAG=("--mode" "text") + fi +fi +# For GitHub Actions this works better +if [ -n "$CI" ] && [ "$CI" = 1 ]; then + INSTALL_MODE_FLAG=("--mode" "unattended") +fi +# For ROS 2 CI, we can check if we're in a Docker container. +if [ -f /.dockerenv ]; then + INSTALL_MODE_FLAG=("--mode" "unattended") +fi + +# Unless they specifically agree to the license. +if [ -n "$I_AGREE_TO_NAO_MESHES_LICENSE" ] && [ "$I_AGREE_TO_NAO_MESHES_LICENSE" = 1 ]; then + INSTALL_MODE_FLAG=("--mode" "unattended") +fi + +# Call the installer, pass our flag and all the remaining arguments +$1 "${INSTALL_MODE_FLAG[@]}" "${@:2}" diff --git a/package.xml b/package.xml index e5a26b6..2fc3325 100644 --- a/package.xml +++ b/package.xml @@ -1,19 +1,23 @@ - + + nao_meshes - 0.1.13 - meshes for the Aldebaran Robotics NAO - Vincent Rabaud - Mikael Arguedas + 2.1.0 + ROS2 Meshes for the NAO robot + Maxime Busy + Victor Paleologue Maxime Busy Surya Ambrose Natalia Lyubova Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License - http://github.com/ros-naoqi/nao_meshes/ + http://github.com/ros-naoqi/nao_meshes2/ + ament_cmake java - catkin + + ament_cmake +