From 9c018af66c554bdeba85d9663e29965a731a12ef Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 12 Sep 2018 11:56:45 +0200 Subject: [PATCH] Add testing against Gazebo in Travis --- .ci/install_debian.sh | 5 ++--- .ci/script.sh | 2 +- .travis.yml | 28 ++++++++++++++++++++-------- README.md | 1 - cmake/BuildICUB.cmake | 10 +++++++++- 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh index d9368533b..3ceeb16ce 100644 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -21,6 +21,5 @@ apt-get install -y python-dev # Octave apt-get install -y liboctave-dev - - - +# Gazebo (use distro packages to support both Ubuntu and Debian) +apt-get install -y libgazebo*-dev diff --git a/.ci/script.sh b/.ci/script.sh index 7e8c93191..d568946dd 100644 --- a/.ci/script.sh +++ b/.ci/script.sh @@ -3,5 +3,5 @@ set -e cd $TRAVIS_BUILD_DIR mkdir build && cd build -cmake -G"${TRAVIS_CMAKE_GENERATOR}" -DROBOTOLOGY_USES_GAZEBO:BOOL=OFF -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON -DROBOTOLOGY_ENABLE_IHMC:BOOL=ON -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} -DNON_INTERACTIVE_BUILD:BOOL=TRUE .. +cmake -G"${TRAVIS_CMAKE_GENERATOR}" -DROBOTOLOGY_USES_GAZEBO:BOOL=ON -DROBOTOLOGY_ENABLE_DYNAMICS:BOOL=ON -DROBOTOLOGY_ENABLE_IHMC:BOOL=ON -DCMAKE_BUILD_TYPE=${TRAVIS_BUILD_TYPE} -DNON_INTERACTIVE_BUILD:BOOL=TRUE .. cmake --build . --config $TRAVIS_BUILD_TYPE diff --git a/.travis.yml b/.travis.yml index 86d248315..280811711 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,12 +57,22 @@ stage_osx: - brew update - brew install ccache - export PATH="/usr/local/opt/ccache/libexec:$PATH" - # Install dependencies + # Install dependencies available from Homebrew/core - brew install ace asio eigen boost tinyxml swig qt5 gsl pkg-config jpeg sqlite tinyxml - export Qt5_DIR=/usr/local/opt/qt5/lib/cmake/Qt5 + # Workaround for https://github.com/travis-ci/travis-ci/issues/8826 + - brew cask uninstall oclint + # Install Gazebo + - brew tap osrf/simulation + - brew install gazebo9 + # Install beautifier for Xcode output + - gem install xcpretty-travis-formatter script: &osx_script - cd $TRAVIS_BUILD_DIR/.ci - - sh ./script.sh + - sh -c 'sh ./script.sh' + script: &osx_script_xcode + - cd $TRAVIS_BUILD_DIR/.ci + - sh -c 'sh ./script.sh | xcpretty -f `xcpretty-travis-formatter`' # ====================== # BUILD JOBS FROM STAGES @@ -80,18 +90,20 @@ jobs: before_install: skip install: *osx_install before_script: skip - script: *osx_script + script: *osx_script_xcode after_failure: skip after_success: skip after_script: skip env: TRAVIS_CMAKE_GENERATOR="Xcode" TRAVIS_BUILD_TYPE="Debug" - - <<: *osx_template - compiler: clang - env: - TRAVIS_CMAKE_GENERATOR="Unix Makefiles" - TRAVIS_BUILD_TYPE="Debug" +# Disabled for now +# - <<: *osx_template +# script: *osx_script +# compiler: clang +# env: +# TRAVIS_CMAKE_GENERATOR="Unix Makefiles" +# TRAVIS_BUILD_TYPE="Debug" notifications: diff --git a/README.md b/README.md index 7a0df8bff..7cd9ce6e0 100644 --- a/README.md +++ b/README.md @@ -464,7 +464,6 @@ on Linux and macOS.** Install Gazebo following the instructions available at http://gazebosim.org/tutorials?cat=install . Make sure to install also the development files, i.e. `libgazebo*-dev` on Debian/Ubuntu. -**Note for macOS uses: at the moment the gazebo9 formula is available on homebrew, but it is not working. Please use the gazebo8 formula until this issue: https://github.com/robotology/robotology-superbuild/issues/52 is fixed, thanks.** ### Configuration Once the superbuild with `ROBOTOLOGY_USES_GAZEBO` enabled has been compiled, it is necessary to append a few superbuild-specific path to the Gazebo enviromental variables: diff --git a/cmake/BuildICUB.cmake b/cmake/BuildICUB.cmake index aaf4ed2a0..f703d17c3 100644 --- a/cmake/BuildICUB.cmake +++ b/cmake/BuildICUB.cmake @@ -16,6 +16,13 @@ if(ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH OR ROBOTOLOGY_ENABLE_ICUB_ROBOT_CAN) list(APPEND ICUB_DEPENDS icub-firmware-shared) endif() +# See discussion in https://github.com/robotology/icub-main/issues/551 +if (APPLE) + set(ICUBMAIN_COMPILE_SIMULATORS OFF) +else() + set(ICUBMAIN_COMPILE_SIMULATORS ON) +endif() + ycm_ep_helper(ICUB TYPE GIT STYLE GITHUB REPOSITORY robotology/icub-main.git @@ -46,4 +53,5 @@ ycm_ep_helper(ICUB TYPE GIT -DENABLE_icubmod_embObjSkin:BOOL=${ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH} -DENABLE_icubmod_embObjStrain:BOOL=${ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH} -DENABLE_icubmod_embObjVirtualAnalogSensor:BOOL=${ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH} - -DENABLE_icubmod_parametricCalibratorEth:BOOL=${ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH}) + -DENABLE_icubmod_parametricCalibratorEth:BOOL=${ROBOTOLOGY_ENABLE_ICUB_ROBOT_ETH} + -DICUBMAIN_COMPILE_SIMULATORS:BOOL=${ICUBMAIN_COMPILE_SIMULATORS})