From dd22afe27cc11da6810c03e4ffc5220c1f89e86d Mon Sep 17 00:00:00 2001 From: Kei Okada Date: Wed, 29 Nov 2023 14:04:21 +0900 Subject: [PATCH] Imported upstream version '0.1.13' of 'upstream' --- .github/workflows/config.yml | 81 ++++ .github/workflows/python2.yml | 18 + .github/workflows/python3.yml | 22 + .travis.yml | 13 +- .../workflows/generate_action_config.py | 105 ++++ .travis/.github/workflows/indigo.yml | 33 ++ .travis/.github/workflows/kinetic.yml | 33 ++ .travis/.github/workflows/main.yml | 401 +++++++++++++++ .travis/.github/workflows/melodic.yml | 33 ++ .travis/.github/workflows/noetic.yml | 33 ++ .travis/.github/workflows/python2.yml | 18 + .travis/.github/workflows/python3.yml | 18 + .travis/.travis.yml | 45 +- .travis/CHANGELOG.rst | 256 ++++++++++ .travis/CMakeLists.txt | 9 +- .travis/README.md | 12 + .travis/action.yml | 207 ++++++++ .travis/docker.sh | 104 +--- .travis/docker/Dockerfile.ros-ubuntu:12.04 | 1 + .../docker/Dockerfile.ros-ubuntu:12.04-base | 6 +- .travis/docker/Dockerfile.ros-ubuntu:14.04 | 12 +- .../docker/Dockerfile.ros-ubuntu:14.04-base | 6 +- .../docker/Dockerfile.ros-ubuntu:14.04-pcl | 75 ++- .../docker/Dockerfile.ros-ubuntu:14.04-pcl1.8 | 91 +++- .../docker/Dockerfile.ros-ubuntu:16.04-base | 6 +- .../docker/Dockerfile.ros-ubuntu:16.04-pcl | 59 ++- .../docker/Dockerfile.ros-ubuntu:18.04-base | 6 +- .../docker/Dockerfile.ros-ubuntu:18.04-pcl | 59 ++- .travis/docker/Dockerfile.ros-ubuntu:20.04 | 48 ++ .../docker/Dockerfile.ros-ubuntu:20.04-base | 5 + .../docker/Dockerfile.ros-ubuntu:20.04-pcl | 42 ++ .travis/docker/Makefile | 45 +- .travis/docker/hooks/build | 3 + .travis/package.xml | 23 +- .travis/rosdep-install.sh | 8 + .travis/test/test_env_var.py | 5 + .travis/test/test_lxml.py | 18 + .travis/test/test_scipy.py | 19 + .travis/travis.sh | 174 +++++-- .travis/travis_jenkins.py | 456 ++++++++++++++---- .travis/travis_utils.sh | 104 ++++ jsk_planning/CHANGELOG.rst | 3 + jsk_planning/package.xml | 2 +- pddl/pddl_msgs/CHANGELOG.rst | 3 + pddl/pddl_msgs/package.xml | 2 +- pddl/pddl_planner/CHANGELOG.rst | 65 +++ pddl/pddl_planner/CMakeLists.txt | 10 + pddl/pddl_planner/README.md | 54 ++- .../demos/2008_okada_ias/demo_pour_tea.launch | 5 +- .../demos/2008_okada_ias/solve-pour-tea.l | 7 +- .../2011_kakiuchi/demo_cleanup_table.launch | 3 +- .../demos/2011_kakiuchi/solve-cleanup-table.l | 2 +- .../demos/2011_saito/demo-knock-door.launch | 5 +- .../demos/2011_saito/demo-simple-task.launch | 3 +- .../2011_saito/demo-taking-elevator.launch | 3 +- .../demos/2011_saito/solve-knock-door.l | 11 +- .../demos/2011_saito/solve-simple-task.l | 2 +- .../demos/2011_saito/solve-taking-elevator.l | 2 +- .../2013_fridge_demo/demo_bring_can.launch | 5 +- .../demos/2013_fridge_demo/solve-bring-can.l | 8 +- .../demos/2016_kamada_durative/demo.launch | 6 + .../demos/2016_kamada_durative/example.launch | 7 + .../demos/2016_kamada_durative/tools.l | 11 +- .../demo_cooperation_task.launch | 10 + .../solve-cooperation-task.l | 193 ++++++++ .../demos/hanoi/demo_hanoi.launch | 5 +- pddl/pddl_planner/demos/hanoi/solve-hanoi.l | 7 +- pddl/pddl_planner/demos/hanoi/solve-hanoi.py | 4 +- .../search_object/demo_search_object.launch | 15 + .../demos/search_object/solve-search-object.l | 16 +- .../demo_simple_failure_torelant.launch | 4 + .../solve-simple-failure-torelant.l | 7 +- .../simple_metric/demo_simple_metric.launch | 6 + .../demo_simple_metric_plan.launch | 6 + .../demos/simple_metric/simple_metric.launch | 16 + .../demos/simple_metric/simple_metric_plan.l | 9 +- pddl/pddl_planner/demos/temporal/README | 11 +- pddl/pddl_planner/package.xml | 2 +- pddl/pddl_planner/samples/agentsystem.py | 4 +- pddl/pddl_planner/src/eus-pddl.l | 21 +- pddl/pddl_planner/src/pddl-result-graph.l | 4 +- pddl/pddl_planner/src/pddl.py | 34 +- pddl/pddl_planner/test/2008_okada_ias.test | 20 + pddl/pddl_planner/test/2011_kakiuchi.test | 25 + .../test/2011_saito_knock_door.test | 26 + pddl/pddl_planner/test/2011_saito_simple.test | 16 + pddl/pddl_planner/test/2013_fridge_demo.test | 30 ++ .../test/2016_kamada_durative.test | 34 ++ pddl/pddl_planner/test/demos_hanoi.test | 17 + pddl/pddl_planner/test/pddlresulttest | 221 +++++++++ pddl/pddl_planner/test/repeat.sh | 10 + pddl/pddl_planner/test/search_object.test | 27 ++ .../test/simple_failure_torelant.test | 20 + pddl/pddl_planner/test/simple_metric.test | 18 + pddl/pddl_planner/test/solve-graph-search.l | 110 +++++ pddl/pddl_planner/test/test-sample-pddl.test | 20 + pddl/pddl_planner_viewer/CHANGELOG.rst | 3 + pddl/pddl_planner_viewer/package.xml | 2 +- task_compiler/CHANGELOG.rst | 8 + task_compiler/euslisp/execute-pddl-core.l | 2 +- task_compiler/package.xml | 2 +- .../samples/clean_planning/si11_pddl.l | 4 +- .../solve-failure-recovery-task.l | 5 +- task_compiler/test/test_task_compiler.test | 3 +- 104 files changed, 3497 insertions(+), 431 deletions(-) create mode 100644 .github/workflows/config.yml create mode 100644 .github/workflows/python2.yml create mode 100644 .github/workflows/python3.yml create mode 100755 .travis/.github/workflows/generate_action_config.py create mode 100644 .travis/.github/workflows/indigo.yml create mode 100644 .travis/.github/workflows/kinetic.yml create mode 100644 .travis/.github/workflows/main.yml create mode 100644 .travis/.github/workflows/melodic.yml create mode 100644 .travis/.github/workflows/noetic.yml create mode 100644 .travis/.github/workflows/python2.yml create mode 100644 .travis/.github/workflows/python3.yml create mode 100644 .travis/action.yml create mode 100644 .travis/docker/Dockerfile.ros-ubuntu:20.04 create mode 100644 .travis/docker/Dockerfile.ros-ubuntu:20.04-base create mode 100644 .travis/docker/Dockerfile.ros-ubuntu:20.04-pcl create mode 100644 .travis/docker/hooks/build create mode 100755 .travis/test/test_lxml.py create mode 100755 .travis/test/test_scipy.py create mode 100644 .travis/travis_utils.sh create mode 100644 pddl/pddl_planner/demos/2020_obinata_cooperation/demo_cooperation_task.launch create mode 100755 pddl/pddl_planner/demos/2020_obinata_cooperation/solve-cooperation-task.l create mode 100644 pddl/pddl_planner/demos/search_object/demo_search_object.launch create mode 100644 pddl/pddl_planner/demos/simple_metric/demo_simple_metric.launch create mode 100644 pddl/pddl_planner/demos/simple_metric/demo_simple_metric_plan.launch create mode 100644 pddl/pddl_planner/demos/simple_metric/simple_metric.launch mode change 100644 => 100755 pddl/pddl_planner/demos/simple_metric/simple_metric_plan.l create mode 100644 pddl/pddl_planner/test/2008_okada_ias.test create mode 100644 pddl/pddl_planner/test/2011_kakiuchi.test create mode 100644 pddl/pddl_planner/test/2011_saito_knock_door.test create mode 100644 pddl/pddl_planner/test/2011_saito_simple.test create mode 100644 pddl/pddl_planner/test/2013_fridge_demo.test create mode 100644 pddl/pddl_planner/test/2016_kamada_durative.test create mode 100644 pddl/pddl_planner/test/demos_hanoi.test create mode 100755 pddl/pddl_planner/test/pddlresulttest create mode 100755 pddl/pddl_planner/test/repeat.sh create mode 100644 pddl/pddl_planner/test/search_object.test create mode 100644 pddl/pddl_planner/test/simple_failure_torelant.test create mode 100644 pddl/pddl_planner/test/simple_metric.test create mode 100755 pddl/pddl_planner/test/solve-graph-search.l diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml new file mode 100644 index 0000000..ecf0c99 --- /dev/null +++ b/.github/workflows/config.yml @@ -0,0 +1,81 @@ +on: + push: + branches: + - master + pull_request: + +env: + DISPLAY: ':0.0' + +jobs: + ros: + runs-on: ubuntu-latest + continue-on-error: false + strategy: + fail-fast: false + matrix: + include: + - ROS_DISTRO: indigo + CONTAINER: jskrobotics/ros-ubuntu:14.04 + NOT_TEST_INSTALL: true + - ROS_DISTRO: kinetic + CONTAINER: jskrobotics/ros-ubuntu:16.04 + - ROS_DISTRO: melodic + CONTAINER: jskrobotics/ros-ubuntu:18.04 + - ROS_DISTRO: noetic + CONTAINER: jskrobotics/ros-ubuntu:20.04 + + container: ${{ matrix.CONTAINER }} + steps: + - name: Install latest git ( use sudo for ros-ubuntu ) + run: | + [ -e /etc/apt/sources.list.d/ubuntu-esm-infra-$(lsb_release -cs).list ] && sudo rm /etc/apt/sources.list.d/ubuntu-esm-infra-$(lsb_release -cs).list ## fix Err https://esm.ubuntu.com trusty-infra-security/main amd64 Packages, gnutls_handshake() failed: Handshake failed + (apt-get update && apt-get install -y sudo) || echo "OK" + sudo apt-get update + sudo apt-get install -y software-properties-common + sudo apt-get update + sudo -E add-apt-repository -y ppa:git-core/ppa + sudo apt-get update + sudo apt-get install -y git + + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + sudo chown -R $USER $GITHUB_WORKSPACE + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + # sudo mkdir -p /home/runner/work/_temp/_github_workflow/ + # sudo chown -R $USER $HOME /home/runner/work/_temp/_github_workflow/ + # ls -al /home/runner/work/_temp/_github_workflow/ + + - name: Chcekout + uses: actions/checkout@v3.0.2 + + - name: Start X server + run: | + if [[ "${{ matrix.CONTAINER }}" =~ "jskrobotics/ros-ubuntu:14.04" ]]; then exit 0; fi + echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections || echo "failing on ros-ubuntu is OK" # set non interactive tzdata https://stackoverflow.com/questions/8671308/non-interactive-method-for-dpkg-reconfigure-tzdata + sudo apt-get -y -qq install mesa-utils x11-xserver-utils xserver-xorg-video-dummy wget + export DISPLAY=:0 + wget https://raw.githubusercontent.com/jsk-ros-pkg/jsk_travis/master/dummy.xorg.conf -O /tmp/dummy.xorg.conf + sudo Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile /tmp/xorg.log -config /tmp/dummy.xorg.conf $DISPLAY & + sleep 3 # wait x server up + export QT_X11_NO_MITSHM=1 # http://wiki.ros.org/docker/Tutorials/GUI + xhost +local:root + shell: bash + + - name: Run jsk_travis + uses: jsk-ros-pkg/jsk_travis@master + with: + ROS_PARALLEL_JOBS : "-j8" + CATKIN_PARALLEL_JOBS : "-p8" + ROS_PARALLEL_TEST_JOBS : "-j1" + CATKIN_PARALLEL_TEST_JOBS : "-p1" + ROS_DISTRO : ${{ matrix.ROS_DISTRO }} + USE_DEB : ${{ matrix.USE_DEB }} + NOT_TEST_INSTALL : ${{ matrix.NOT_TEST_INSTALL }} + TEST_PKGS : ${{ matrix.TEST_PKGS }} + EXTRA_DEB : ${{ matrix.EXTRA_DEB }} diff --git a/.github/workflows/python2.yml b/.github/workflows/python2.yml new file mode 100644 index 0000000..72f28a3 --- /dev/null +++ b/.github/workflows/python2.yml @@ -0,0 +1,18 @@ +# generated by `./generate_action_config.py noetic` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python2 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python2 + run: | + apt update -q && apt install -y -q python2 + python2 -m compileall . diff --git a/.github/workflows/python3.yml b/.github/workflows/python3.yml new file mode 100644 index 0000000..2e6dc49 --- /dev/null +++ b/.github/workflows/python3.yml @@ -0,0 +1,22 @@ +# generated by `./generate_action_config.py noetic` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python3 + + container: ubuntu:20.04 + + steps: + - name: Install latest git to download .git directory in actions/checkout@v2 ( use sudo for ros-ubuntu ) + run: apt-get update && apt-get install -y software-properties-common && apt-get update && add-apt-repository -y ppa:git-core/ppa && apt-get update && apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: git config --global --add safe.directory $GITHUB_WORKSPACE + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python3 + run: | + apt update -q && apt install -y -q python3 git 2to3 + bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . > /dev/null; echo Exitting with \$ret; exit \$ret" diff --git a/.travis.yml b/.travis.yml index e2d081e..978283a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,23 @@ +sudo: true +dist: bionic language: generic notifications: email: on_success: always on_failure: always slack: jsk-robotics:Av7tc8wj3IWkLYvlTzHE7x2g +addons: + apt: + packages: + - 2to3 services: - docker env: global: - USE_DOCKER=true matrix: + - CHECK_PYTHON3_COMPILE=true + - CHECK_PYTHON2_COMPILE=true - ROS_DISTRO=hydro USE_DEB=false - ROS_DISTRO=indigo USE_DEB=true - ROS_DISTRO=jade USE_DEB=true @@ -21,4 +29,7 @@ matrix: - env: ROS_DISTRO=hydro USE_DEB=false - env: ROS_DISTRO=indigo USE_DEB=true - env: ROS_DISTRO=jade USE_DEB=true -script: source .travis/travis.sh +script: + - if [ "${CHECK_PYTHON2_COMPILE}" == "true" ]; then python2 -m compileall .; exit $?; fi + - if [ "${CHECK_PYTHON3_COMPILE}" == "true" ]; then bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . :^.travis > /dev/null; echo Exitting with \$ret; exit \$ret"; exit $?; fi + - source .travis/travis.sh diff --git a/.travis/.github/workflows/generate_action_config.py b/.travis/.github/workflows/generate_action_config.py new file mode 100755 index 0000000..0545b0f --- /dev/null +++ b/.travis/.github/workflows/generate_action_config.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python + +# script to generate Github Action workflow config file + +import argparse +import sys +from collections import defaultdict + +def get_argument_parser(): + parser = argparse.ArgumentParser(description="Create .github/workflows/*.yml for Github Actions") + add = parser.add_argument + add('distros', nargs='+', help="distros to check on github actions") + add('--verbose', '-v', action='store_true', default=False, help="show debug message") + return parser + +def main(sysargs): + parser = get_argument_parser() + args = parser.parse_args(sys.argv[1:]) + distros = args.distros + verbose = args.verbose + # + program = ' '.join(sys.argv) + + for distro in distros: + print("Generate {}.yml".format(distro)) + checkout = defaultdict(lambda: 'actions/checkout@v2',hydro='actions/checkout@v1')[distro] + container = defaultdict(lambda: 'jskrobotics/ros-ubuntu:18.04', + hydro = 'jskrobotics/ros-ubuntu:12.04', + indigo = 'jskrobotics/ros-ubuntu:14.04', + kinetic= 'jskrobotics/ros-ubuntu:16.04', + melodic= 'jskrobotics/ros-ubuntu:18.04', + noetic = 'jskrobotics/ros-ubuntu:20.04')[distro] + with open('{}.yml'.format(distro), mode='w') as f: + f.write('''# generated by `%(program)s` +# jsk_travis +on: [push, pull_request] + +jobs: + %(distro)s: + runs-on: ubuntu-latest + name: %(distro)s + + container: %(container)s + + steps: + - name: Install latest git ( use sudo for ros-ubuntu, remove sudo for ubuntu container), checkout@v2 uses REST API for git<2.18, which removes .git folder and does not checkout .travis submodules + run: sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + - name: Before Checkout # need for actions/checkout with ros-ubuntu container + run: sudo chown -R user:jenkins $RUNNER_WORKSPACE $HOME + - name: Checkout + uses: %(checkout)s + - name: Run jsk_travis + uses: jsk-ros-pkg/jsk_travis@master + with: + ROS_DISTRO : %(distro)s +''' % locals()) + + # python3 test + print("Generate python3.yml") + with open('python3.yml', mode='w') as f: + f.write('''# generated by `%(program)s` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python3 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python3 + run: | + apt update -q && apt install -y -q python3 + python3 -m compileall . +''' % locals()) + # python2 test + print("Generate python2.yml") + with open('python2.yml', mode='w') as f: + f.write('''# generated by `%(program)s` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python2 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check python2 + run: | + apt update -q && apt install -y -q python2 + python2 -m compileall . +''' % locals()) + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:]) or 0) diff --git a/.travis/.github/workflows/indigo.yml b/.travis/.github/workflows/indigo.yml new file mode 100644 index 0000000..19c0baf --- /dev/null +++ b/.travis/.github/workflows/indigo.yml @@ -0,0 +1,33 @@ +# generated by `./generate_action_config.py indigo kinetic melodic noetic` +# jsk_travis +on: [push, pull_request] + +env: + TEST_VAR1: true + TEST_VAR2: false + +jobs: + indigo: + runs-on: ubuntu-latest + name: indigo + + container: jskrobotics/ros-ubuntu:14.04 + + steps: + - name: Install latest git ( use sudo for ros-ubuntu, remove sudo for ubuntu container), checkout@v2 uses REST API for git<2.18, which removes .git folder and does not checkout .travis submodules + run: sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + - name: Checkout + uses: actions/checkout@v2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : indigo diff --git a/.travis/.github/workflows/kinetic.yml b/.travis/.github/workflows/kinetic.yml new file mode 100644 index 0000000..7482c89 --- /dev/null +++ b/.travis/.github/workflows/kinetic.yml @@ -0,0 +1,33 @@ +# generated by `./generate_action_config.py indigo kinetic melodic noetic` +# jsk_travis +on: [push, pull_request] + +env: + TEST_VAR1: true + TEST_VAR2: false + +jobs: + kinetic: + runs-on: ubuntu-latest + name: kinetic + + container: jskrobotics/ros-ubuntu:16.04 + + steps: + - name: Install latest git ( use sudo for ros-ubuntu, remove sudo for ubuntu container), checkout@v2 uses REST API for git<2.18, which removes .git folder and does not checkout .travis submodules + run: sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + - name: Checkout + uses: actions/checkout@v2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : kinetic diff --git a/.travis/.github/workflows/main.yml b/.travis/.github/workflows/main.yml new file mode 100644 index 0000000..7651d2e --- /dev/null +++ b/.travis/.github/workflows/main.yml @@ -0,0 +1,401 @@ +# jsk_travis +on: [push, pull_request] + +env: + TEST_VAR1: true + TEST_VAR2: false + +jobs: + jenkins_hydro: + name: jenkins_hydro + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : hydro + TIMEOUT_JENKINS: 60 + + jenkins_indigo: + name: jenkins_indigo + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : indigo + TIMEOUT_JENKINS: 60 + + jenkins_kinetic: + name: jenkins_kinetic + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : kinetic + TIMEOUT_JENKINS: 60 + + jenkins_kinetic_pcl: + name: jenkins_kinetic_pcl + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : kinetic + DOCKER_IMAGE_JENKINS : ros-ubuntu:16.04-pcl + TIMEOUT_JENKINS: 60 + + jenkins_melodic: + name: jenkins_melodic + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : melodic + TIMEOUT_JENKINS: 60 + + jenkins_melodic_pcl: + name: jenkins_melodic_pcl + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : melodic + DOCKER_IMAGE_JENKINS : ros-ubuntu:18.04-pcl + TIMEOUT_JENKINS: 60 + + jenkins_noetic: + name: jenkins_noetic + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : noetic + TIMEOUT_JENKINS: 60 + + jenkins_noetic_pcl: + name: jenkins_noetic_pcl + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + USE_JENKINS: true + ROS_DISTRO : noetic + DOCKER_IMAGE_JENKINS : ros-ubuntu:20.04-pcl + TIMEOUT_JENKINS: 60 + + hydro: + name: hydro + runs-on: ubuntu-latest + container: ubuntu:12.04 + steps: + - name: Checkout + uses: actions/checkout@v1 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : hydro + + indigo: + name: indigo + runs-on: ubuntu-latest + container: ubuntu:14.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : indigo + + kinetic: + name: kinetic + runs-on: ubuntu-latest + container: ubuntu:16.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : kinetic + + melodic: + name: melodic + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic + + melodic_catkin_make: + name: melodic_catkin_make + runs-on: ubuntu-latest + container: ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic + USE_CATKIN_MAKE : true + BEFORE_SCRIPT : "pwd; git clone http://github.com/jsk-ros-pkg/jsk_common_msgs" + NOT_TEST_INSTALL : true + + melodic_test_packages: + name: melodic_test_packages + runs-on: ubuntu-latest + container : ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic + TEST_PKGS : "" + + melodic_repository_path: + name: melodic_repository_path + runs-on: ubuntu-latest + container : ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic + ROS_REPOSITORY_PATH : http://packages.ros.org/ros/ubuntu + + # since https://github.blog/2021-09-01-improving-git-protocol-security-github/ we can not use git:// + # we need to remove git:// from submodules and .rosinstall + melodic_unencrypted_git_protocol: + name: melodic_unencrypted_git_protocol + runs-on: ubuntu-latest + container : ubuntu:18.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Add pr2eus repository to .travis.rosinstall + run: | + echo "- git:" >> .travis.rosinstall + echo " local-name: jsk-ros-pkg/jsk_pr2eus" >> .travis.rosinstall + echo " uri: https://github.com/jsk-ros-pkg/jsk_pr2eus.git" >> .travis.rosinstall + echo " version: a228cc7d3bb5b26b92ed25c7d55f32a64d9d7825" >> .travis.rosinstall + pwd + ls -al + cat .travis.rosinstall + - name: Run jsk_travis + uses: ./ + with: + ROS_DISTRO : melodic + USE_DEB : false + TEST_PKGS : "" + + noetic: + name: noetic + runs-on: ubuntu-latest + container : ubuntu:20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : noetic + + noetic_python2: + name: noetic_python2 + runs-on: ubuntu-latest + container : ubuntu:20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : noetic + ROS_PYTHON_VERSION : 2 + ROSDEP_ADDITIONAL_OPTIONS : "-n -q -r --ignore-src" + BEFORE_SCRIPT : "sudo pip install empy" + TEST_PKGS : "rospy_tutorials" + + noetic_python3: + name: noetic_python3 + runs-on: ubuntu-latest + container: ubuntu:20.04 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : noetic + ROS_PYTHON_VERSION : 3 + + docker_kinetic: + name: docker_kinetic + runs-on: ubuntu-latest + container: jskrobotics/ros-ubuntu:16.04 + steps: + - name: Before Checkout # need for actoins/checkout with ros-ubuntu container + run: sudo chown -R user:jenkins $RUNNER_WORKSPACE $HOME + - name: Checkout + uses: actions/checkout@v2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : kinetic + + docker_melodic: + name: docker_melodic + runs-on: ubuntu-latest + container: jskrobotics/ros-ubuntu:18.04 + steps: + - name: Before Checkout # need for actoins/checkout with ros-ubuntu container + run: sudo chown -R user:jenkins $RUNNER_WORKSPACE $HOME + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic + + docker_noetic: + name: docker_noetic + runs-on: ubuntu-latest + container: jskrobotics/ros-ubuntu:20.04 + steps: + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : noetic + + check_python3: + name: check_python3 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + - name: Check python3 + run: | + apt update -q && apt install -y -q python3 + python3 -m compileall . diff --git a/.travis/.github/workflows/melodic.yml b/.travis/.github/workflows/melodic.yml new file mode 100644 index 0000000..5b88dfd --- /dev/null +++ b/.travis/.github/workflows/melodic.yml @@ -0,0 +1,33 @@ +# generated by `./generate_action_config.py indigo kinetic melodic noetic` +# jsk_travis +on: [push, pull_request] + +env: + TEST_VAR1: true + TEST_VAR2: false + +jobs: + melodic: + runs-on: ubuntu-latest + name: melodic + + container: jskrobotics/ros-ubuntu:18.04 + + steps: + - name: Install latest git ( use sudo for ros-ubuntu, remove sudo for ubuntu container), checkout@v2 uses REST API for git<2.18, which removes .git folder and does not checkout .travis submodules + run: sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + - name: Checkout + uses: actions/checkout@v2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : melodic diff --git a/.travis/.github/workflows/noetic.yml b/.travis/.github/workflows/noetic.yml new file mode 100644 index 0000000..07860bd --- /dev/null +++ b/.travis/.github/workflows/noetic.yml @@ -0,0 +1,33 @@ +# generated by `./generate_action_config.py indigo kinetic melodic noetic` +# jsk_travis +on: [push, pull_request] + +env: + TEST_VAR1: true + TEST_VAR2: false + +jobs: + noetic: + runs-on: ubuntu-latest + name: noetic + + container: jskrobotics/ros-ubuntu:20.04 + + steps: + - name: Install latest git ( use sudo for ros-ubuntu, remove sudo for ubuntu container), checkout@v2 uses REST API for git<2.18, which removes .git folder and does not checkout .travis submodules + run: sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git + - name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613 + run: | + set -x + export USER=$(whoami) + git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok + sudo mkdir -p /__w/ + sudo chmod 777 -R /__w/ + sudo chown -R $USER $HOME + - name: Checkout + uses: actions/checkout@v2 + - name: Run jsk_travis + uses: ./ + with: + ADDITIONAL_ENV_TO_DOCKER: 'TEST_VAR1 TEST_VAR2' + ROS_DISTRO : noetic diff --git a/.travis/.github/workflows/python2.yml b/.travis/.github/workflows/python2.yml new file mode 100644 index 0000000..bbc9dfc --- /dev/null +++ b/.travis/.github/workflows/python2.yml @@ -0,0 +1,18 @@ +# generated by `generate_action_config.py noetic .` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python2 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check python2 + run: | + apt update -q && apt install -y -q python2 + python2 -m compileall . diff --git a/.travis/.github/workflows/python3.yml b/.travis/.github/workflows/python3.yml new file mode 100644 index 0000000..79d4a0a --- /dev/null +++ b/.travis/.github/workflows/python3.yml @@ -0,0 +1,18 @@ +# generated by `./generate_action_config.py indigo kinetic melodic noetic` +# jsk_travis +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + name: check_python3 + + container: ubuntu:20.04 + + steps: + - name: Chcekout + uses: actions/checkout@v2 + - name: Check Python3 + run: | + apt update -q && apt install -y -q python3 + python3 -m compileall . diff --git a/.travis/.travis.yml b/.travis/.travis.yml index 8e82562..2e2afdb 100644 --- a/.travis/.travis.yml +++ b/.travis/.travis.yml @@ -2,7 +2,6 @@ # Generic MoveIt Travis Continuous Integration Configuration File # Works with all MoveIt! repositories/branches # Author: Dave Coleman, Jonathan Bohren -language: c++ cache: apt: true pip: true @@ -10,8 +9,9 @@ cache: - $HOME/.ccache - $HOME/.cache/pip - $HOME/apt-cacher-ng -sudo: required -dist: trusty +sudo: true +dist: bionic +language: python services: - docker notifications: @@ -22,6 +22,7 @@ env: - TEST_VAR1=true - TEST_VAR2=false - ADDITIONAL_ENV_TO_DOCKER='TEST_VAR1 TEST_VAR2' + # - CATKIN_TOOLS_BUILD_OPTIONS="-iv --summarize --no-status --make-args VERBOSE=1 --" matrix: # travis + jsk jenkins - ROS_DISTRO=hydro USE_JENKINS="true" NO_SUDO="true" @@ -30,18 +31,16 @@ env: - ROS_DISTRO=indigo TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis TRAVIS_BRANCH=master TRAVIS_COMMIT='HEAD' TRAVIS_PULL_REQUEST='false' - ROS_DISTRO=indigo DOCKER_IMAGE_JENKINS=ros-ubuntu:14.04-pcl - ROS_DISTRO=indigo DOCKER_IMAGE_JENKINS=ros-ubuntu:14.04-pcl1.8 - - ROS_DISTRO=jade - - ROS_DISTRO=jade TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis - - ROS_DISTRO=jade TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis TRAVIS_BRANCH=master TRAVIS_COMMIT='HEAD' TRAVIS_PULL_REQUEST='false' - # travis - - USE_TRAVIS=true ROS_DISTRO=indigo - - USE_TRAVIS=true ROS_DISTRO=indigo TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis - - USE_TRAVIS=true ROS_DISTRO=indigo TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis TRAVIS_BRANCH=master TRAVIS_COMMIT='HEAD' TRAVIS_PULL_REQUEST='false' - - USE_TRAVIS=true ROS_DISTRO=jade - - USE_TRAVIS=true ROS_DISTRO=jade TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis - - USE_TRAVIS=true ROS_DISTRO=jade TRAVIS_REPO_SLUG=jsk-ros-pkg/jsk_travis TRAVIS_BRANCH=master TRAVIS_COMMIT='HEAD' TRAVIS_PULL_REQUEST='false' + - ROS_DISTRO=kinetic + - ROS_DISTRO=kinetic DOCKER_IMAGE_JENKINS=ros-ubuntu:16.04-pcl + - ROS_DISTRO=melodic + - ROS_DISTRO=melodic DOCKER_IMAGE_JENKINS=ros-ubuntu:18.04-pcl + - ROS_DISTRO=noetic + - ROS_DISTRO=noetic DOCKER_IMAGE_JENKINS=ros-ubuntu:20.04-pcl + # use docker image - USE_JENKINS=true ROS_DISTRO=kinetic DOCKER_IMAGE_JENKINS=ros-ubuntu:16.04-pcl - USE_JENKINS=true ROS_DISTRO=melodic DOCKER_IMAGE_JENKINS=ros-ubuntu:18.04-pcl + - USE_JENKINS=true ROS_DISTRO=noetic DOCKER_IMAGE_JENKINS=ros-ubuntu:20.04-pcl # travis + docker - USE_DOCKER=true ROS_DISTRO=hydro - USE_DOCKER=true ROS_DISTRO=hydro USE_CATKIN_MAKE=true BEFORE_SCRIPT="pwd; git clone http://github.com/jsk-ros-pkg/jsk_common_msgs" NOT_TEST_INSTALL=true @@ -57,32 +56,48 @@ env: - USE_DOCKER=true ROS_DISTRO=kinetic - USE_DOCKER=true ROS_DISTRO=lunar - USE_DOCKER=true ROS_DISTRO=melodic + - USE_DOCKER=true ROS_DISTRO=noetic ROS_PYTHON_VERSION=2 + - USE_DOCKER=true ROS_DISTRO=noetic ROS_PYTHON_VERSION=3 + - USE_DOCKER=true ROS_DISTRO=noetic # gazebo - USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=indigo - USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=jade - USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=kinetic + - USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=melodic + - USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=noetic - USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=indigo - USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=jade - USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=kinetic + - USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=melodic + - USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=noetic matrix: fast_finish: true allow_failures: + - env: USE_JENKINS=true ROS_DISTRO=noetic DOCKER_IMAGE_JENKINS=ros-ubuntu:20.04-pcl # failing due to Moc, see https://forum.qt.io/topic/113347/moc-gets-stuck-when-running-in-a-docker-container + - env: USE_DOCKER=true ROS_DISTRO=noetic ROS_PYTHON_VERSION=2 # ??? - env: USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=jade - env: USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=kinetic - env: USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=jade - env: USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=kinetic + - env: USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=melodic + - env: USE_DOCKER=true TEST_GAZEBO=true ROS_DISTRO=noetic + - env: USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=noetic + - env: USE_JENKINS=true TEST_GAZEBO=true ROS_DISTRO=melodic before_script: - find $HOME/.ccache -type f - find $HOME/.cache/pip -type f - export ROSDEP_ADDITIONAL_OPTIONS='-n -v --ignore-src' # run rosdep without -q, -r and -v - - mkdir .travis; cp -r * .travis # need to copy, since directory starting from . is ignoreed by catkin build + - if [ ${ROS_DISTRO} == "hydro" ]; then export BEFORE_SCRIPT="sed -ie \"/-pip/ d\" \${CI_SOURCE_PATH}/package.xml;${BEFORE_SCRIPT}"; fi # FIXME hydro does not have python >= 2.7.9, so it fails on pip install + - if [ ${ROS_DISTRO} == "noetic" ]; then export BEFORE_SCRIPT="sed -ie \"/gazebo/ d\" \${CI_SOURCE_PATH}/package.xml;${BEFORE_SCRIPT}"; fi # FIXME gazebo is not released in noetic + - if [ ${ROS_DISTRO} == "noetic" ]; then export BEFORE_SCRIPT="touch ros_tutorials/turtlesim/CATKIN_IGNORE; ${BEFORE_SCRIPT}"; fi # qt5/moc does not work on docker (https://stackoverflow.com/questions/56319830/error-when-building-qt-app-in-a-recent-docker) + - mkdir .travis; mv *.sh *.py *.conf .travis/ # need to move, since directory starting from . is ignoreed by catkin build - export BEFORE_SCRIPT="rm -fr jsk_travis/CATKIN_IGNORE; git clone https://github.com/ros/ros_tutorials -b ${ROS_DISTRO}-devel;${BEFORE_SCRIPT}" - if [ "${USE_CATKIN_MAKE}" == "true" ] ;then sed -i 's@catkin build -i -v --limit-status-rate 0.001@catkin_make@' .travis/travis.sh; fi - if [ "${USE_CATKIN_MAKE}" == "true" ] ;then sed -i 's@catkin run_tests --no-deps --limit-status-rate 0.001@catkin_make run_tests@' .travis/travis.sh; fi - if [ "${USE_CATKIN_MAKE}" == "true" ] ;then export CATKIN_PARALLEL_JOBS="--no-color" ; fi script: - if [ "${TEST_GAZEBO}" = "true" ]; then export CATKIN_TOOLS_BUILD_OPTIONS="--force-cmake --cmake-args -DENABLE_TEST_GAZEBO:BOOL=ON --"; fi - - source .travis/travis.sh + - .travis/travis.sh after_script: - find $HOME/.ccache -type f - find $HOME/.cache/pip -type f diff --git a/.travis/CHANGELOG.rst b/.travis/CHANGELOG.rst index 6b3ce38..d90fdea 100644 --- a/.travis/CHANGELOG.rst +++ b/.travis/CHANGELOG.rst @@ -2,6 +2,262 @@ Changelog for package jsk_travis ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.5.25 (2022-05-13) +------------------- +* add CATKNI_IGNORE, whcih is wrongly removed in 728c456 +* Do apt-get update before install package (`#446 `_) +* enable to set TIMEOUT in Jenkins (default 120)f( `#443 `_) +* fix permision issue https://github.com/actions/checkout/issues/760#issuecomment-1097501613 (`#442 `_) + +* Contributors: Kei Okada, Iori Yanokura + +0.5.24 (2022-03-23) +------------------- +* add melodic_unencrypted_git_protocol to cehck git:// (`#438 `_) + + * use snapshot of rosdep list for Dockerfile.ros-ubuntu:14.04-pcl1.8 + * replace git:// with https:// in .gitmodules to work with github enw security protocols (https://github.blog/2021-09-01-improving-git-protocol-security-github/) + * add melodic_unencrypted_git_protocol to cehck git:// + +* Contributors: Kei Okada + +0.5.23 (2021-12-29) +------------------- +* add test to check if rosdep correctly install python-lxml, see https://github.com/ros/rosdistro/issues/31569 (`#437 `_) + + * use snapshot of rosdep list for eol distros + +* Contributors: Kei Okada + +0.5.22 (2021-09-03) +------------------- +* remove duplicate keyf( `#428 `_) +* add python2.yml github actions (`#435 `_) + + * add .github/workflows/distro.yml generated by generate_action_config.py + +* [generate_action_config.py] fix typo (`#430 `_) +* run apt-get update, after apt-add-repository ppa:git-core/ppa (`#436 `_) +* do not timeout catkin build with travis_wait on GithubActions (`#434 `_) +* change to old-releases in 12.04 dockerfiles (`#431 `_) + + * change to old-releases for jenkins, too. + * use old-releases.ubuntu.com for old ubuntu distribution (precise) + +* Contributors: Kei Okada, Naoki Hiraoka, Shingo Kitagawa + +0.5.21 (2021-05-08) +------------------- +* fix .github/workflows to git update submodules (`#427 `_) + + * git submodule update --init .travis for non jsk_travis pacakges + +* skip code only used in jsk_travis (`#426 `_) + + * default branch name for jsk_travis is master + +* add hooks/build for docker automatead test (`#425 `_) + + * moveit-ros-perception is not available as for 2021/5/5 http://repositories.ros.org/status_page/ros_noetic_default.html?q=moveit_ros_perception + * apt-get update and remove apt cache every run + we need to apt-get update in every steps to get latest apt information + we need to remove apt cache in every steps to make docker images lighter + +* add on: [pull_request] (`#422 `_) + + * add each tests with individual workflow, to re-run single job, see https://github.community/t/ability-to-rerun-just-a-single-job-in-a-workflow/17234/41 + +* try to build dockerhub images from jsk_travis/docker #420 (`#420 `_) + + * ubuntu 14.04 need Python >= 2.7.9 to run pip + * use INCLUDE+ syntax, to run docker build within same directory, without using built images: see https://stackoverflow.com/a/65567427 + +* enable to run github actions, until travis back (`#421 `_) + + * add status badge + * support actions.yml, add exmaple files under .github/workflows/*.yml + * .travis.yml -> .github/workflow/main.yml + * travis_jenkins.py: send all environment variable through parameters, not config file + * do not build docker file on travis_jenkins + * use random value for TRAVIS_JENKINS_UNIQUE_ID + * somehow cat /dev/urandom whtin command substitution did not work on Github actions, not sure why + +* Contributors: Kei Okada, Shingo Kitagawa + +0.5.20 (2021-04-28) +------------------- +* fix travis to work (again....) (`#419 `_) + + * pip install -I pip<9 does not work on hydro + * reinstall pip-9 from pypi, otherwise + ``` + ImportError: Entry point ('console_scripts', 'pip2') not found + ``` + occurs + * instal python >= 2.7.9 on ros-ubuntu:14.04-base + * hydro does not like lates pip install.... + * apply turtlesim/CATKIN_IGNORE for all noetic tests + * fix hydro pip remove + * 20.04 needs pip + * hydro does not have python >= 2.7.9, so it fails on pip install, comment out pip depends + * do not error when pip/python is not installed + * set noninteractive before apt-get install + * On ubuntu >= 18, does not need to install pip + * pypa requires python >= 2.7.9, where trusty uses pyton 2.7.6, install ppa veresion of python2.7.13 + * since .travis.yml move to bionic, do not run indigo/jade on travis + * update .travis.yml to bionic + * --user install is not supported + * mkdir -p /root/.cache/pip/ + * fix travis problem, fix apt-ag-cacher, could not install get-pip.py, git clone fails of protocol.version2... + add python-pip, on 14.04 get-pip.py fils with + +curl https://bootstrap.pypa.io/pip/2.7/get-pip.py + +sudo python - + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 1863k 100 1863k 0 0 10.9M 0 --:--:-- --:--:-- --:--:-- 10.9M + DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. + WARNING: The directory '/home/travis/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. + /tmp/tmpqCDyYn/pip.zip/pip/_vendor/urllib3/util/ssl\_.py:424: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings + /tmp/tmpqCDyYn/pip.zip/pip/_vendor/urllib3/util/ssl\_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings + ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none) + ERROR: No matching distribution found for pip<21.0 + /tmp/tmpqCDyYn/pip.zip/pip/_vendor/urllib3/util/ssl\_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings + + * install decorator==4.4.2 +* Contributors: Kei Okada, Shingo Kitagawa + +0.5.19 (2021-03-09) +------------------- +* update 2.7/get-pip.py url (`#416 `_) + + fix https://bootstrap.pypa.io/2.7/get-pip.py to + https://bootstrap.pypa.io/pip/2.7/get-pip.py + ``` + +curl https://bootstrap.pypa.io/2.7/get-pip.py + +sudo python - + % Total % Received % Xferd Average Speed Time Time Time Current + Dload Upload Total Spent Left Speed + 100 936 100 936 0 0 11036 0 --:--:-- --:--:-- --:--:-- 11142 + Hi there! + The URL you are using to fetch this script has changed, and this one will no + longer work. Please use get-pip.py from the following URL instead: + https://bootstrap.pypa.io/pip/2.7/get-pip.py + Sorry if this change causes any inconvenience for you! + We don't have a good mechanism to make more gradual changes here, and this + renaming is a part of an effort to make it easier to us to update these + scripts, when there's a pip release. It's also essential for improving how we + handle the `get-pip.py` scripts, when pip drops support for a Python minor + version. + There are no more renames/URL changes planned, and we don't expect that a need + would arise to do this again in the near future. + Thanks for understanding! + - Pradyun, on behalf of the volunteers who maintain pip. + ``` +* Contributors: Kei Okada + +0.5.18 (2021-01-27) +------------------- +* use 2.7 get-pip.py to install pip 20.3.4 to run on python2.7 (`#414 `_) + * use 2.7 get-pip.py because pip 21.0 is released, which droped python 2.7 support in january 2021. + https://pip.pypa.io/en/latest/development/release-process/#python-2-support +* Contributors: Shingo Kitagawa + +0.5.17 (2020-09-29) +------------------- +* move to .travis directory to load travis_utils.sh (`#412 `_) +* Contributors: Kei Okada + +0.5.16 (2020-09-28) +------------------- +* fix last release 0.5.15 (`#411 `_) + + * use GLOB_RECOURSE to install scripts in test code + * source travis_utils.sh from .travis.sh directory + * mv all scripts into .travis and run tests + +* Contributors: Kei Okada + +0.5.15 (2020-09-24) +------------------- +* docker: install common packages for '-pcl', and reenable CACHEBUST (`#410 `_) + + * add travis_utils + * clean up travis results + +* Contributors: Kei Okada + +0.5.14 (2020-09-08) +------------------- +* add /workspace/.chainer cache directory (`#409 `_) + +* Contributors: Kei Okada + +0.5.13 (2020-08-27) +------------------- +* Fix for new jenkins (`#407 `_) + + * check if 'number' in item['executable'] + * add comment when j.reconfig_job fails + * disable CACHEBUST, use --pull --no-cache to build, https://developer.devada.com/docs/appendix-a-troubleshooting-answerhub-docker-startup + +* Contributors: Kei Okada + +0.5.12 (2020-06-28) +------------------- +* check USE_JENKINS=true ROS_DISTRO=noetic without DOCKER_IMAGE_JENKINS (`#405 `_) + + * install python3-pip for 20.04 + * add python-gdown-pip to run_depend to check pip install + * qt5/moc does not work on docker (https://stackoverflow.com/questions/56319830/error-when-building-qt-app-in-a-recent-docker) + * add CATKIN_TOOLS_BUILD_OPTIONS for debug + * ros_tutorials now support noetic-devel + * install 'python' for noetic + * check USE_JENKINS=true ROS_DISTRO=noetic without DOCKER_IMAGE_JENKINS + +* Contributors: Kei Okada + +0.5.11 (2020-05-28) +------------------- +* update rosdep-install.sh for indigo, which does not read <*_depend condition="$ROS_PYTHON=VERSION == 2"> format (`#403 `_) + + * remove condition=ROS_PYTHON=VERSION=2 for indigo + * use scipy instead of numpy, because numpy is already installed + * show debug message to stderr + * check if rosdep works with format=3 + * add more travis_time_start/travis_time_end + +* Fix 0.5.10, which does not work for melodic/noetic (`#402 `_) + + * add USE_DOCKER=true ROS_DISTRO=noetic + * do not print debug message end of docker.sh + * fix when ROS_PYTHON_VERSION is not set + * add USE_DOCKER=true ROS_DISTRO=noetic + +* Contributors: Kei Okada + +0.5.10 (2020-05-02) +------------------- +* add support noetic/focal (`#401 `_) +* Contributors: Kei Okada + +0.5.9 (2020-04-03) +------------------ +* output all messages to sys.stderr (`#398 `_) +* Contributors: Kei Okada + +0.5.8 (2020-04-02) +------------------ +* Fix utf-8/ascii errors (`#397 `_)) + + * fix for https://github.com/start-jsk/rtmros_common/pull/1089 + * PYTHONIOENCODING=utf-8 fix utf-8 + * support python3 + * use python-jenkins 1.7.0 + * set unicode for print console output + * add DEBUG_TRAVIS_PYTHON + +* Contributors: Kei Okada + 0.5.7 (2019-12-11) ------------------ * Enable to pass additional environment variables to docker on travis/jenkins (`#395 `_) diff --git a/.travis/CMakeLists.txt b/.travis/CMakeLists.txt index 36cb158..f2e3ba4 100644 --- a/.travis/CMakeLists.txt +++ b/.travis/CMakeLists.txt @@ -7,6 +7,11 @@ add_rostest(test/example.test) if(CATKIN_ENABLE_TESTING) # For testing ADDITIONAL_ENV_TO_DOCKER catkin_add_nosetests(test/test_env_var.py) + # Check if rosdep is correctly install scipy + if ("$ENV{ROS_DISTRO}" STRGREATER "hydro") # hydro does not install pip scipy + catkin_add_nosetests(test/test_scipy.py) + catkin_add_nosetests(test/test_lxml.py) + endif() endif() set(ENABLE_TEST_GAZEBO OFF CACHE BOOL "Option to enable testing gazebo") @@ -14,5 +19,7 @@ if(ENABLE_TEST_GAZEBO) add_rostest(test/gazebo.test) endif() -install(FILES rosdep-install.sh travis_jenkins.py travis.sh +file(GLOB_RECURSE script_files RELATIVE ${PROJECT_SOURCE_DIR} *.sh *.py) +message(STATUS "install ${script_files}") +install(FILES ${script_files} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) diff --git a/.travis/README.md b/.travis/README.md index d5c1f4d..14a3b07 100644 --- a/.travis/README.md +++ b/.travis/README.md @@ -2,6 +2,7 @@ [![Join the chat at https://gitter.im/jsk-ros-pkg/jsk_travis](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jsk-ros-pkg/jsk_travis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/jsk-ros-pkg/jsk_travis.svg?branch=master)](https://travis-ci.org/jsk-ros-pkg/jsk_travis) +[![.github/workflows/main.yml](https://github.com/jsk-ros-pkg/jsk_travis/actions/workflows/main.yml/badge.svg)](https://github.com/jsk-ros-pkg/jsk_travis/actions/workflows/main.yml) ![](_media/jsk_travis_diagram.png) @@ -57,6 +58,12 @@ see [this document](https://github.com/jsk-ros-pkg/jsk_common#restart-travis-fro Specify your target distribution of ROS. Now we support hydro, indigo and jade. If you specify indigo or jade, tests automatically run on jenkins. +* `ROS_PYTHON_VERSION` (default: none) + + Specify your target python version used of ROS. Available from Noetic. + see [Build Using Python3](http://wiki.ros.org/UsingPython3/BuildUsingPython3) and + [rep 149](https://github.com/ros-infrastructure/rep/blob/master/rep-0149.rst) + * `USE_DEB` (value: [`true`|`false`|`source`]) If `false`, travis firstly sees [config files](#config-files) to resolve dependencies, @@ -126,6 +133,11 @@ see [this document](https://github.com/jsk-ros-pkg/jsk_common#restart-travis-fro You can specify multiple variables separated by a space. e.g. `IS_EUSLISP_TRAVIS_TEST IS_GAZEBO_TRAVIS_TEST` +* `DEBUG_TRAVIS_PYTHON` (default: none) + + Specify python command to run within travis/docker/jenkins, + for example set `DEBUG_TRAVIS_PYTHON` to `python -v` + ## Config Files * `.travis.rosinstall`, `.travis.rosinstall.{{ ROS_DISTRO }}` diff --git a/.travis/action.yml b/.travis/action.yml new file mode 100644 index 0000000..59e5a01 --- /dev/null +++ b/.travis/action.yml @@ -0,0 +1,207 @@ +name: 'Dockerfile for speedup jsk_travis' +author: 'JSK Robotics Laboratory' +description: 'Dockerfile for speedup jsk_travis, try docker run --rm -ti jskrobotics:ros-ubuntu:18.04-pcl' +inputs: + ROS_DISTRO: + description: 'Specify your target distribution of ROS' + required: true + default: melodic + ADDITIONAL_ENV_TO_DOCKER: + description: > + Specify environment variables you want to pass to docker on + travis/jenkins. You can specify multiple variables separated by + a space. e.g. `IS_EUSLISP_TRAVIS_TEST IS_GAZEBO_TRAVIS_TEST` + BEFORE_SCRIPT: + description: > + `BEFORE_SCRIPT` is used to specify shell commands which run + before building packages. Some characters won\'t work without + escaping it for xml on Jenkins. (see: + [here](https://github.com/jsk-ros-pkg/jsk_travis/issues/171)) + BUILD_PKGS: + description: > + You can specify the packages to build and test. If your + repository has some troubles about several packages, you can + ignore them by this option like `BUILD_PKGS="jsk_pcl_ros + jsk_recognition_msgs"`. + CATKIN_PARALLEL_JOBS: + description: > + The number of catkin parallel processes in build. + CATKIN_PARALLEL_TEST_JOBS: + description: > + The number of catkin parallel processes in test. + default: '-p4' + CATKIN_TOOLS_BUILD_OPTIONS: + description: > + Options to be passed like `catkin build + $CATKIN_TOOLS_BUILD_OPTIONS`. (default: `-iv --summarize + --no-status` for `catkin-tools==0.3.X` and `--summarize + --no-status` for `catkin-tools` of other version.) + CATKIN_TOOLS_CONFIG_OPTIONS: + description: > + Options to be passed like `catkin config + $CATKIN_TOOLS_CONFIG_OPTIONS`. + CMAKE_DEVELOPER_ERROR: + description: > + Flag to show CMake developer error in catkin run_tests. + DEBUG_TRAVIS_PYTHON: + description: > + Specify python command to run within travis/docker/jenkins, for + example set `DEBUG_TRAVIS_PYTHON` to `python -v` + DOCKER_IMAGE_JENKINS: + description: > + Docker image used in Jenkins., (defualt: + `ros-ubuntu:$(lsb_release -sr)`) + TIMEOUT_JENKINS: + description: > + Timeout minutes in Jenkins., (defualt: 120) + EXTRA_DEB: + description: > + You can specify extra deb packages by `EXTRA_DEB` variable. The + packages are installed before building packages. + NOT_TEST_INSTALL: + description: > + Flag to skip testing catkin install in addition to devel + build. i.e. If true, skip testing. + ROSDEP_ADDITIONAL_OPTIONS: + description: > + The options passed when rosdep install.(default: \'-n -q -r + --ignore-src\') + ROSDEP_UPDATE_QUIET: + description: > + Set true to disable verbose option for \'rosdep update\' + ROS_LOG_DIR: + description: > + Specify ROS_LOG_DIR + (http://wiki.ros.org/ROS/EnvironmentVariables#ROS_LOG_DIR), + otherwise uses ~/.ros/test_results + ROS_PARALLEL_JOBS: + description: > + Specify ROS_PARALLEL_JOBS environment, (defult: -j8) + ROS_PARALLEL_TEST_JOBS: + description: > + Specify ROS_PARALLEL_TEST_JOBS environment, (defult: -j8) + ROS_PYTHON_VERSION: + description: > + Specify your target python version used of ROS. Available from + Noetic. see [Build Using + Python3](http://wiki.ros.org/UsingPython3/BuildUsingPython3) and + [rep 149](https://github.com/ros-infrastructure/rep/blob/master/rep-0149.rst) + ROS_REPOSITORY_PATH: + description: > + Specify ROS repository path, (defualt: + http://packages.ros.org/ros-testing/ubuntu) + TARGET_PKGS: + description: > + Specify packages to build + TEST_PKGS: + description: > + Specify packages to test + USE_CATKIN_MAKE: + description: > + Set true to use `catkin_make` + USE_DEB: + description: > + If `false`, travis firstly sees [config + files](https://github.com/jsk-ros-pkg/jsk_travis#config-files) + to resolve dependencies and then installs left dependencies by + apt. If `source`, travis does not sees [config + files](https://github.com/jsk-ros-pkg/jsk_travis#config-files) + but runs `setup_upstream.sh` + file. See [here](https://github.com/jsk-ros-pkg/jsk_roseus) for + example. + USE_JENKINS: + description: > + Force to run test on jenkins. jenkins server is more powerful + than travis environment, so we can use jenkins to compile + pcl-related packages such as + [jsk_recognition](https://github.com/jsk-ros-pkg/jsk_recognition.git). This + variable needs to be `true` to run test with [container-based travis + environment](http://docs.travis-ci.com/user/workers/container-based-infrastructure/). This + overwrites default configuration described + [here](https://github.com/jsk-ros-pkg/jsk_travis#where-test-runs). + default: 'false' + USE_PYTHON_VIRTUALENV: + description: > + Set true to use python virtualenv + USE_TRAVIS: + description: > + force to run test on Github Actions + + +runs: + using: "composite" + steps: + - name: Install system commands + run: | + export DEBIAN_FRONTEND=noninteractive + if [ "$EUID" -eq 0 ]; then # if we run with root + # check if archive.ubuntu.com is available in this distribution + apt-get -y -qq update || if [ $? -eq 100 ]; then sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; apt-get -y -qq update; fi + apt-get -y -qq install sudo + fi + # install fundamental packages + sudo -E apt-get -y -qq update + sudo -E apt-get -y -qq install apt-utils build-essential curl git lsb-release wget + # 20.04 does not have pip, so install get-pip.py + sudo -E apt-get -y -qq install python-pip python-setuptools || (sudo -E apt-get -y -qq install python; curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo -E python; sudo -E apt-get -y -qq install python3-pip) + shell: bash + - name: Run jsk_travis test + run: | + if [[ "${GITHUB_REPOSITORY#*/}" == "jsk_travis" ]]; then set -x; fi + # unset if not defined + if [[ "${{ inputs.ADDITIONAL_ENV_TO_DOCKER }}" != "" ]]; then export ADDITIONAL_ENV_TO_DOCKER="${{ inputs.ADDITIONAL_ENV_TO_DOCKER }}"; fi + if [[ "${{ inputs.BEFORE_SCRIPT }}" != "" ]]; then export BEFORE_SCRIPT="${{ inputs.BEFORE_SCRIPT }}"; fi + if [[ "${{ inputs.BUILD_PKGS }}" != "" ]]; then export BUILD_PKGS="${{ inputs.BUILD_PKGS }}"; fi + if [[ "${{ inputs.CATKIN_PARALLEL_JOBS }}" != "" ]]; then export CATKIN_PARALLEL_JOBS="${{ inputs.CATKIN_PARALLEL_JOBS }}"; fi + if [[ "${{ inputs.CATKIN_PARALLEL_TEST_JOBS }}" != "" ]]; then export CATKIN_PARALLEL_TEST_JOBS="${{ inputs.CATKIN_PARALLEL_TEST_JOBS }}"; fi + if [[ "${{ inputs.CATKIN_TOOLS_BUILD_OPTIONS }}" != "" ]]; then export CATKIN_TOOLS_BUILD_OPTIONS="${{ inputs.CATKIN_TOOLS_BUILD_OPTIONS }}"; fi + if [[ "${{ inputs.CATKIN_TOOLS_CONFIG_OPTIONS }}" != "" ]]; then export CATKIN_TOOLS_CONFIG_OPTIONS="${{ inputs.CATKIN_TOOLS_CONFIG_OPTIONS }}"; fi + if [[ "${{ inputs.CMAKE_DEVELOPER_ERROR }}" != "" ]]; then export CMAKE_DEVELOPER_ERROR="${{ inputs.CMAKE_DEVELOPER_ERROR }}"; fi + if [[ "${{ inputs.DEBUG_TRAVIS_PYTHON }}" != "" ]]; then export DEBUG_TRAVIS_PYTHON="${{ inputs.DEBUG_TRAVIS_PYTHON }}"; fi + if [[ "${{ inputs.DOCKER_IMAGE_JENKINS }}" != "" ]]; then export DOCKER_IMAGE_JENKINS="${{ inputs.DOCKER_IMAGE_JENKINS }}"; fi + if [[ "${{ inputs.TIMEOUT_JENKINS }}" != "" ]]; then export TIMEOUT_JENKINS="${{ inputs.TIMEOUT_JENKINS }}"; fi + if [[ "${{ inputs.EXTRA_DEB }}" != "" ]]; then export EXTRA_DEB="${{ inputs.EXTRA_DEB }}"; fi + if [[ "${{ inputs.NOT_TEST_INSTALL }}" != "" ]]; then export NOT_TEST_INSTALL="${{ inputs.NOT_TEST_INSTALL }}"; fi + if [[ "${{ inputs.ROSDEP_ADDITIONAL_OPTIONS }}" != "" ]]; then export ROSDEP_ADDITIONAL_OPTIONS="${{ inputs.ROSDEP_ADDITIONAL_OPTIONS }}"; fi + if [[ "${{ inputs.ROSDEP_UPDATE_QUIET }}" != "" ]]; then export ROSDEP_UPDATE_QUIET="${{ inputs.ROSDEP_UPDATE_QUIET }}"; fi + if [[ "${{ inputs.ROS_DISTRO }}" != "" ]]; then export ROS_DISTRO="${{ inputs.ROS_DISTRO }}"; fi + if [[ "${{ inputs.ROS_LOG_DIR }}" != "" ]]; then export ROS_LOG_DIR="${{ inputs.ROS_LOG_DIR }}"; fi + if [[ "${{ inputs.ROS_PARALLEL_JOBS }}" != "" ]]; then export ROS_PARALLEL_JOBS="${{ inputs.ROS_PARALLEL_JOBS }}"; fi + if [[ "${{ inputs.ROS_PARALLEL_TEST_JOBS }}" != "" ]]; then export ROS_PARALLEL_TEST_JOBS="${{ inputs.ROS_PARALLEL_TEST_JOBS }}"; fi + if [[ "${{ inputs.ROS_PYTHON_VERSION }}" != "" ]]; then export ROS_PYTHON_VERSION="${{ inputs.ROS_PYTHON_VERSION }}"; fi + if [[ "${{ inputs.ROS_REPOSITORY_PATH }}" != "" ]]; then export ROS_REPOSITORY_PATH="${{ inputs.ROS_REPOSITORY_PATH }}"; fi + if [[ "${{ inputs.TARGET_PKGS }}" != "" ]]; then export TARGET_PKGS="${{ inputs.TARGET_PKGS }}"; fi + if [[ "${{ inputs.TEST_PKGS }}" != "" ]]; then export TEST_PKGS="${{ inputs.TEST_PKGS }}"; fi + if [[ "${{ inputs.USE_CATKIN_MAKE }}" != "" ]]; then export USE_CATKIN_MAKE="${{ inputs.USE_CATKIN_MAKE }}"; fi + if [[ "${{ inputs.USE_DEB }}" != "" ]]; then export USE_DEB="${{ inputs.USE_DEB }}"; fi + if [[ "${{ inputs.USE_JENKINS }}" != "" ]]; then export USE_JENKINS="${{ inputs.USE_JENKINS }}"; else export USE_JENKINS="false"; fi + if [[ "${{ inputs.USE_PYTHON_VIRTUALENV }}" != "" ]]; then export USE_PYTHON_VIRTUALENV="${{ inputs.USE_PYTHON_VIRTUALENV }}"; fi + if [[ "${{ inputs.USE_TRAVIS }}" != "" ]]; then export USE_TRAVIS="${{ inputs.USE_TRAVIS }}"; else if [[ "${{ inputs.USE_JENKINS }}" == "true" ]]; then export USE_TRAVIS="false"; else export USE_TRAVIS="true"; fi; fi # if not USE_JENKINS, use travis(github actions) + # to compatible with travis + export TRAVIS_BRANCH=${GITHUB_REF#refs/heads/} + export TRAVIS_REPO_SLUG=${GITHUB_REPOSITORY} + export TRAVIS_JOB_ID=${GITHUB_RUN_ID} + export TRAVIS_JOB_NUMBER=${GITHUB_RUN_NUMBER} + export TRAVIS_COMMIT=${GITHUB_SHA} + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then export TRAVIS_PULL_REQUEST=${GITHUB_REF#refs/pull/}; export TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST%/merge}; else export TRAVIS_PULL_REQUEST=false; fi + ## jsk_travis only codes start here + if [[ "${GITHUB_REPOSITORY#*/}" == "jsk_travis" ]]; then + env + if [ "${ROS_DISTRO}" == "hydro" ]; then export BEFORE_SCRIPT="sed -ie \"/-pip/ d\" \${CI_SOURCE_PATH}/package.xml;${BEFORE_SCRIPT}"; fi # FIXME hydro does not have python >= 2.7.9, so it fails on pip install + if [ "${ROS_DISTRO}" == "noetic" ]; then export BEFORE_SCRIPT="sed -ie \"/gazebo/ d\" \${CI_SOURCE_PATH}/package.xml;${BEFORE_SCRIPT}"; fi # FIXME gazebo is not released in noetic + if [ "${ROS_DISTRO}" == "noetic" ]; then export BEFORE_SCRIPT="touch ros_tutorials/turtlesim/CATKIN_IGNORE; ${BEFORE_SCRIPT}"; fi # qt5/moc does not work on docker (https://stackoverflow.com/questions/56319830/error-when-building-qt-app-in-a-recent-docker) + mkdir .travis; mv *.sh *.py *.conf .travis/ # need to move, since directory starting from . is ignoreed by catkin build + export BEFORE_SCRIPT="rm -fr jsk_travis/CATKIN_IGNORE; git clone https://github.com/ros/ros_tutorials -b ${ROS_DISTRO}-devel;${BEFORE_SCRIPT}" + if [ "${USE_CATKIN_MAKE}" == "true" ] ;then sed -i 's@catkin build -i -v --limit-status-rate 0.001@catkin_make@' .travis/travis.sh; fi + if [ "${USE_CATKIN_MAKE}" == "true" ] ;then sed -i 's@catkin run_tests --no-deps --limit-status-rate 0.001@catkin_make run_tests@' .travis/travis.sh; fi + if [ "${USE_CATKIN_MAKE}" == "true" ] ;then export CATKIN_PARALLEL_JOBS="--no-color" ; fi + if [ "${TEST_GAZEBO}" = "true" ]; then export CATKIN_TOOLS_BUILD_OPTIONS="--force-cmake --cmake-args -DENABLE_TEST_GAZEBO:BOOL=ON --"; fi + else + git submodule update --init .travis + fi + .travis/travis.sh + shell: bash + +branding: + icon: 'wind' + color: 'blue' \ No newline at end of file diff --git a/.travis/docker.sh b/.travis/docker.sh index 04107c7..6e80ffa 100755 --- a/.travis/docker.sh +++ b/.travis/docker.sh @@ -1,112 +1,22 @@ #!/bin/bash -# travis related functions (copied from https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh) -export ANSI_RED="\033[31;1m" -export ANSI_GREEN="\033[32;1m" -export ANSI_BLUE="\033[34;1m" -export ANSI_RESET="\033[0m" -export ANSI_CLEAR="\033[0K" - -function travis_time_start { - set +x - TRAVIS_START_TIME=$(date +%s%N) - TRAVIS_TIME_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1) - TRAVIS_FOLD_NAME=$1 - echo -e "${ANSI_CLEAR}traivs_fold:start:$TRAVIS_FOLD_NAME" - echo -e "${ANSI_CLEAR}traivs_time:start:$TRAVIS_TIME_ID${ANSI_BLUE}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${ANSI_RESET}" - set -x -} -export -f travis_time_start - -function travis_time_end { - set +x - _COLOR=${1:-32} - TRAVIS_END_TIME=$(date +%s%N) - TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME)/1000000000 )) - echo -e "traivs_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n${ANSI_CLEAR}" - echo -e "traivs_fold:end:$TRAVIS_FOLD_NAME\e[${_COLOR}m<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<${ANSI_RESET}" - echo -e "${ANSI_CLEAR}\e[${_COLOR}mFunction $TRAVIS_FOLD_NAME takes $(( $TIME_ELAPSED_SECONDS / 60 )) min $(( $TIME_ELAPSED_SECONDS % 60 )) sec${ANSI_RESET}" - set -x -} -export -f travis_time_end - -function travis_wait { - set +x - local timeout=$1 - - if [[ $timeout =~ ^[0-9]+$ ]]; then - # looks like an integer, so we assume it's a timeout - shift - else - # default value - timeout=20 - fi - - local cmd="$@" - local log_file=travis_wait_$$.log - - $cmd &>$log_file & - local cmd_pid=$! - - travis_jigger $! $timeout $cmd & - local jigger_pid=$! - local result - - { - wait $cmd_pid 2>/dev/null - result=$? - ps -p$jigger_pid &>/dev/null && kill $jigger_pid - } - - if [ $result -eq 0 ]; then - echo -e "\n${ANSI_GREEN}The command $cmd exited with $result.${ANSI_RESET}" - else - echo -e "\n${ANSI_RED}The command $cmd exited with $result.${ANSI_RESET}" - fi - - echo -e "\n${ANSI_GREEN}Log:${ANSI_RESET}\n" - cat $log_file - - set -x - return $result -} -export -f travis_wait - -function travis_jigger { - # helper method for travis_wait() - local cmd_pid=$1 - shift - local timeout=$1 # in minutes - shift - local count=0 - - # clear the line - echo -e "\n" - - while [ $count -lt $timeout ]; do - count=$(($count + 1)) - echo -ne "Still running ($count of $timeout): $@\r" - sleep 60 - done - - echo -e "\n${ANSI_RED}Timeout (${timeout} minutes) reached. Terminating \"$@\"${ANSI_RESET}\n" - kill -9 $cmd_pid -} -export -f travis_jigger - -# end of travis related functions +. $(dirname "${BASH_SOURCE[0]}")/travis_utils.sh travis_time_start setup_docker export DEBIAN_FRONTEND=noninteractive if [ "$(which sudo)" = "" ]; then - apt-get -y -qq update + # check if archive.ubuntu.com is available in this distribution + apt-get -y -qq update || if [ $? -eq 100 ]; then sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; apt-get -y -qq update; fi apt-get -y -qq install sudo fi + # install fundamental packages sudo -E apt-get -y -qq update -sudo -E apt-get -y -qq install apt-utils build-essential curl git lsb-release python-pip python-setuptools wget +sudo -E apt-get -y -qq install apt-utils build-essential curl git lsb-release wget +# 20.04 does not have pip, so install get-pip.py +sudo -E apt-get -y -qq install python-pip python-setuptools || (sudo -E apt-get -y -qq install python; curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo -E python; sudo -E apt-get -y -qq install python3-pip) # add user for testing adduser --disabled-password --gecos "" travis diff --git a/.travis/docker/Dockerfile.ros-ubuntu:12.04 b/.travis/docker/Dockerfile.ros-ubuntu:12.04 index 71a4841..9a71efa 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:12.04 +++ b/.travis/docker/Dockerfile.ros-ubuntu:12.04 @@ -5,6 +5,7 @@ FROM ubuntu:12.04 #### # install packages +RUN apt-get update || if [ $? -eq 100 ]; then sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; apt-get update; fi RUN apt-get update && apt-get install -q -y dirmngr gnupg2 lsb-release sudo wget # setup keys diff --git a/.travis/docker/Dockerfile.ros-ubuntu:12.04-base b/.travis/docker/Dockerfile.ros-ubuntu:12.04-base index 4a94a0f..b435ded 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:12.04-base +++ b/.travis/docker/Dockerfile.ros-ubuntu:12.04-base @@ -1,5 +1,5 @@ -FROM ros-ubuntu:12.04 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:12.04 -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 RUN sudo apt-get update && sudo apt-get dist-upgrade -y diff --git a/.travis/docker/Dockerfile.ros-ubuntu:14.04 b/.travis/docker/Dockerfile.ros-ubuntu:14.04 index 523820b..ff3ed5c 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:14.04 +++ b/.travis/docker/Dockerfile.ros-ubuntu:14.04 @@ -13,7 +13,13 @@ RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y python-vtk tcl-vtk RUN apt-get update && apt-get install -y python-pip -RUN pip install -U dlib +# Install pip +# See https://github.com/pypa/pip/issues/4805 for detail. +# https://github.com/pypa/pypi-support/issues/978 requires Python >= 2.7.9 +RUN apt-get update && sudo apt-get install -y software-properties-common +RUN add-apt-repository -y ppa:longsleep/python2.7-backports +RUN apt-get update && sudo apt-get dist-upgrade -y +RUN pip install -U dlib==19.21.1 RUN apt-get update && apt-get install -y curl git wget sudo lsb-release ccache apt-cacher-ng patch man-db RUN apt-get update && apt-get install -y mesa-utils @@ -25,6 +31,10 @@ RUN sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 0xCBF125EA RUN apt-get update && apt-get install -y ros-jade-ros-base ## +# https://github.com/pypa/pypi-support/issues/978 requires Python >= 2.7.9 +RUN sudo apt-get install -y software-properties-common +RUN sudo add-apt-repository ppa:longsleep/python2.7-backports && sudo apt-get update && sudo apt-get dist-upgrade -y + RUN addgroup --gid 976 jenkins RUN adduser --uid 983 --disabled-password --gecos "" --force-badname --ingroup jenkins user diff --git a/.travis/docker/Dockerfile.ros-ubuntu:14.04-base b/.travis/docker/Dockerfile.ros-ubuntu:14.04-base index 4a8a559..110ea9b 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:14.04-base +++ b/.travis/docker/Dockerfile.ros-ubuntu:14.04-base @@ -1,5 +1,5 @@ -FROM ros-ubuntu:14.04 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:14.04 -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 RUN sudo apt-get update && sudo apt-get dist-upgrade -y diff --git a/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl b/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl index 1b3c113..b63e2f3 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl +++ b/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl @@ -1,15 +1,60 @@ -FROM ros-ubuntu:14.04 - -RUN sudo apt-get update -RUN sudo apt-get install -y python-vtk tcl-vtk -RUN sudo apt-get install -y ros-indigo-pcl-conversions ros-indigo-pcl-ros ros-indigo-octomap-server -RUN sudo apt-get install -y ros-indigo-rviz ros-indigo-robot-self-filter ros-indigo-moveit-ros-perception -RUN sudo apt-get install -y libopencv-dev liblapack-dev -RUN sudo apt-get install -y emacs cython -RUN rosdep update --include-eol-distros -RUN rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # image_view -RUN rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # qt_gui_core - -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 -RUN sudo apt-get update && sudo apt-get dist-upgrade -y +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:14.04 + +RUN sudo apt-get update && \ + sudo apt-get install -y python-vtk tcl-vtk && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y ros-indigo-pcl-conversions ros-indigo-pcl-ros ros-indigo-octomap-server && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y ros-indigo-rviz ros-indigo-robot-self-filter ros-indigo-moveit-ros-perception && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y libopencv-dev liblapack-dev && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y emacs cython && \ + sudo rm -rf /var/lib/apt/lists/* + +# image_view +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt_gui_core +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# libqt5-gui +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve libqt5-gui | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt5-qmake +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve qt5-qmake | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# python-h5py +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-h5py | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y octave festival && \ + sudo rm -rf /var/lib/apt/lists/* + +# pip installed tornado (5.1.1) fails on 14.04 +RUN sudo apt-get update && \ + sudo apt-get install -y python-tornado && \ + sudo rm -rf /var/lib/apt/lists/* + +# fix latest pip install fcn errors +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python -; sudo -H pip install 'pip<10' +RUN sudo pip install fcn chainercv chainer==6.7.0 cupy-cuda91 decorator==4.4.2 + +# install package to speedup +RUN sudo pip install freezegun diff --git a/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl1.8 b/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl1.8 index 30d3e96..b5e470b 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl1.8 +++ b/.travis/docker/Dockerfile.ros-ubuntu:14.04-pcl1.8 @@ -1,4 +1,6 @@ -FROM ros-ubuntu:14.04 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:14.04 RUN cd ~ && \ wget -q https://github.com/PointCloudLibrary/pcl/archive/pcl-1.8.0rc2.tar.gz && \ @@ -13,25 +15,96 @@ RUN cd ~/pcl-pcl-1.8.0rc2 && \ RUN mkdir -p ~/ros/ws_jsk_recognition/src && \ cd ~/ros/ws_jsk_recognition/src && \ - sudo apt-get install -y python-rosinstall-generator python-wstool && \ + sudo apt-get update && \ + sudo apt-get install -y python-rosinstall-generator python-wstool python-catkin-tools && \ rosinstall_generator --tar --rosdistro indigo \ pcl_conversions \ pcl_ros \ octomap_server \ > .rosinstall && \ - wstool up -j -1 + wstool up -j -1 && \ + sudo rm -rf /var/lib/apt/lists/* + +# use snapshot of rosdep list +# https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517 +RUN sudo rm /etc/ros/rosdep/sources.list.d/20-default.list && \ + sudo wget https://gist.githubusercontent.com/cottsay/b27a46e53b8f7453bf9ff637d32ea283/raw/476b3714bb90cfbc6b8b9d068162fc6408fa7f76/30-xenial.list -O /etc/ros/rosdep/sources.list.d/30-xenial.list RUN cd ~/ros/ws_jsk_recognition/src && \ + sudo apt-get update && \ rosdep update --include-eol-distros && \ - rosdep install --from-path . -y -i + rosdep install --from-path . -y -i && \ + sudo rm -rf /var/lib/apt/lists/* RUN cd ~/ros/ws_jsk_recognition && \ - sudo apt-get install -y python-catkin-tools && \ . /opt/ros/indigo/setup.sh && \ catkin build -RUN sudo apt-get install -y python-vtk tcl-vtk +RUN sudo apt-get update && \ + sudo apt-get install -y python-vtk tcl-vtk && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y ros-indigo-pcl-conversions ros-indigo-pcl-ros ros-indigo-octomap-server && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y ros-indigo-rviz ros-indigo-robot-self-filter ros-indigo-moveit-ros-perception && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y libopencv-dev liblapack-dev && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y emacs cython && \ + sudo rm -rf /var/lib/apt/lists/* + +# image_view +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt_gui_core +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# libqt5-gui +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve libqt5-gui | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt5-qmake +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve qt5-qmake | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# python-h5py +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-h5py | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* + +RUN sudo apt-get update && \ + sudo apt-get install -y octave festival && \ + sudo rm -rf /var/lib/apt/lists/* + + +# pip installed tornado (5.1.1) fails on 14.04 +RUN sudo apt-get update && \ + sudo apt-get install -y python-tornado && \ + sudo rm -rf /var/lib/apt/lists/* + +# fix latest pip install fcn errors +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python -; sudo -H pip install 'pip<10' +RUN sudo pip install fcn chainercv chainer==6.7.0 cupy-cuda91 decorator==4.4.2 + -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 -RUN sudo apt-get update && sudo apt-get dist-upgrade -y +# install common package to speedup +RUN sudo pip install freezegun +RUN sudo apt-get update && \ + sudo apt-get install -y libshiboken-dev shiboken \ + python-qt4 python-qt4-dev python-sip-dev libvtk-java \ + libgtk2.0-dev \ + python-pyside libpyside-dev \ + ros-indigo-rqt-reconfigure python-matplotlib imagemagick \ + python-rosinstall-generator python-wstool \ + ros-indigo-pcl-msgs ros-indigo-octomap-msgs && \ + sudo rm -rf /var/lib/apt/lists/* diff --git a/.travis/docker/Dockerfile.ros-ubuntu:16.04-base b/.travis/docker/Dockerfile.ros-ubuntu:16.04-base index c45b4a8..005d9c8 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:16.04-base +++ b/.travis/docker/Dockerfile.ros-ubuntu:16.04-base @@ -1,5 +1,5 @@ -FROM ros-ubuntu:16.04 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:16.04 -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 RUN sudo apt-get update && sudo apt-get dist-upgrade -y diff --git a/.travis/docker/Dockerfile.ros-ubuntu:16.04-pcl b/.travis/docker/Dockerfile.ros-ubuntu:16.04-pcl index 39b5476..d91b656 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:16.04-pcl +++ b/.travis/docker/Dockerfile.ros-ubuntu:16.04-pcl @@ -1,14 +1,47 @@ -FROM ros-ubuntu:16.04 - -RUN sudo apt-get update -RUN sudo apt-get install -y ros-kinetic-pcl-conversions ros-kinetic-pcl-ros ros-kinetic-octomap-server -RUN sudo apt-get install -y ros-kinetic-rviz ros-kinetic-robot-self-filter ros-kinetic-moveit-ros-perception -RUN sudo apt-get install -y libopencv-dev liblapack-dev -RUN sudo apt-get install -y emacs cython -RUN rosdep update --include-eol-distros -RUN rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # image_view -RUN rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # qt_gui_core - -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:16.04 + +RUN sudo apt-get update && \ + sudo apt-get install -y ros-kinetic-pcl-conversions ros-kinetic-pcl-ros ros-kinetic-octomap-server && \ + sudo rm -rf /var/lib/apt/lists/* + +RUN sudo apt-get update && \ + sudo apt-get install -y ros-kinetic-rviz ros-kinetic-robot-self-filter ros-kinetic-moveit-ros-perception && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y libopencv-dev liblapack-dev && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y emacs cython && \ + sudo rm -rf /var/lib/apt/lists/* + +# image_view +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt_gui_core +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# fix latest pip install fcn errors +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python -; sudo -H pip install 'pip<10' +RUN sudo pip install fcn chainercv chainer==6.7.0 cupy-cuda91 decorator==4.4.2 + +# install common package to speedup +RUN sudo pip install freezegun +RUN sudo apt-get update && \ + sudo apt-get install -y libshiboken-dev shiboken \ + python-qt4 python-qt4-dev python-sip-dev libvtk-java \ + libgtk2.0-dev \ + python-pyside libpyside-dev \ + ros-kinetic-rqt-reconfigure python-matplotlib imagemagick \ + python-rosinstall-generator python-wstool \ + ros-kinetic-pcl-msgs ros-kinetic-octomap-msgs && \ + sudo rm -rf /var/lib/apt/lists/* + ARG CACHEBUST=1 -RUN sudo apt-get update && sudo apt-get dist-upgrade -y +RUN echo $CACHBUST +RUN sudo apt-get update && sudo apt-get dist-upgrade -y && sudo rm -rf /var/lib/apt/lists/* diff --git a/.travis/docker/Dockerfile.ros-ubuntu:18.04-base b/.travis/docker/Dockerfile.ros-ubuntu:18.04-base index b2085de..d4794c9 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:18.04-base +++ b/.travis/docker/Dockerfile.ros-ubuntu:18.04-base @@ -1,5 +1,5 @@ -FROM ros-ubuntu:18.04 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:18.04 -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 -ARG CACHEBUST=1 RUN sudo apt-get update && sudo apt-get dist-upgrade -y diff --git a/.travis/docker/Dockerfile.ros-ubuntu:18.04-pcl b/.travis/docker/Dockerfile.ros-ubuntu:18.04-pcl index c839c16..a84dd1e 100644 --- a/.travis/docker/Dockerfile.ros-ubuntu:18.04-pcl +++ b/.travis/docker/Dockerfile.ros-ubuntu:18.04-pcl @@ -1,14 +1,47 @@ -FROM ros-ubuntu:18.04 - -RUN sudo apt-get update -RUN sudo apt-get install -y ros-melodic-pcl-conversions ros-melodic-pcl-ros ros-melodic-octomap-server -RUN sudo apt-get install -y ros-melodic-rviz ros-melodic-robot-self-filter ros-melodic-moveit-ros-perception -RUN sudo apt-get install -y libopencv-dev liblapack-dev -RUN sudo apt-get install -y emacs cython -RUN rosdep update --include-eol-distros -RUN rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # image_view -RUN rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # qt_gui_core - -# https://github.com/moby/moby/issues/1996#issuecomment-185872769 +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:18.04 + +RUN sudo apt-get update && \ + sudo apt-get install -y ros-melodic-pcl-conversions ros-melodic-pcl-ros ros-melodic-octomap-server && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y ros-melodic-rviz ros-melodic-robot-self-filter ros-melodic-moveit-ros-perception && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y libopencv-dev liblapack-dev && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y emacs cython && \ + sudo rm -rf /var/lib/apt/lists/* + +# image_view +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# qt_gui_core +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* + +# fix latest pip install fcn errors +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python -; sudo -H pip install 'pip<10' +RUN sudo pip install fcn chainercv chainer==6.7.0 cupy-cuda91 decorator==4.4.2 + +# install common package to speedup +RUN sudo pip install freezegun +RUN sudo apt-get update && \ + sudo apt-get install -y libshiboken-dev shiboken \ + python-qt4 python-qt4-dev python-sip-dev \ + libgtk2.0-dev \ + python-pyside libpyside-dev \ + ros-melodic-rqt-reconfigure python-matplotlib imagemagick \ + python-rosinstall-generator python-wstool \ + ros-melodic-pcl-msgs ros-melodic-octomap-msgs && \ + sudo rm -rf /var/lib/apt/lists/* + ARG CACHEBUST=1 -RUN sudo apt-get update && sudo apt-get dist-upgrade -y +RUN echo $CACHBUST +RUN sudo apt-get update && sudo apt-get dist-upgrade -y && sudo rm -rf /var/lib/apt/lists/* diff --git a/.travis/docker/Dockerfile.ros-ubuntu:20.04 b/.travis/docker/Dockerfile.ros-ubuntu:20.04 new file mode 100644 index 0000000..f41b070 --- /dev/null +++ b/.travis/docker/Dockerfile.ros-ubuntu:20.04 @@ -0,0 +1,48 @@ +FROM ubuntu:focal + +# setup sources.list +RUN apt-get update && apt-get install -y gnupg +RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 +RUN echo "deb http://packages.ros.org/ros-testing/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list + +# install +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections +RUN apt-get update && apt-get install -y \ + ros-noetic-ros-comm \ + ros-noetic-roscpp-tutorials \ + ros-noetic-rospy-tutorials \ + && rm -rf /var/lib/apt/lists/* + +# +RUN apt-get update && apt-get install -y python3-rosdep +RUN rosdep init && rosdep update + +ENV ROS_DISTRO noetic + +# FROM ros:noetic-ros-base + +RUN apt-get update && apt-get dist-upgrade -y + +RUN apt-get update && apt-get install -y \ + wget \ + libboost-all-dev \ + libeigen3-dev \ + libflann-dev \ + libqhull-dev \ + libvtk6-dev + +RUN apt-get update && apt-get install -y python3-pip +RUN pip3 install -U dlib + +RUN apt-get update && apt-get install -y curl git wget sudo lsb-release ccache apt-cacher-ng patch man-db +RUN apt-get update && apt-get install -y mesa-utils +RUN apt-get update && apt-get install -y --force-yes -q -qq mongodb-clients mongodb-server -o Dpkg::Options::=--force-confdef + +RUN apt-get update && apt-get install -y python # some tools (get-pip.py) requires 'python' to install + +RUN addgroup --gid 976 jenkins +RUN adduser --uid 983 --disabled-password --gecos "" --force-badname --ingroup jenkins user + +RUN sed -i '/^%sudo/ a user ALL=(ALL) NOPASSWD: ALL' /etc/sudoers + +USER user diff --git a/.travis/docker/Dockerfile.ros-ubuntu:20.04-base b/.travis/docker/Dockerfile.ros-ubuntu:20.04-base new file mode 100644 index 0000000..c784869 --- /dev/null +++ b/.travis/docker/Dockerfile.ros-ubuntu:20.04-base @@ -0,0 +1,5 @@ +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:20.04 + +RUN sudo apt-get update && sudo apt-get dist-upgrade -y diff --git a/.travis/docker/Dockerfile.ros-ubuntu:20.04-pcl b/.travis/docker/Dockerfile.ros-ubuntu:20.04-pcl new file mode 100644 index 0000000..5726a65 --- /dev/null +++ b/.travis/docker/Dockerfile.ros-ubuntu:20.04-pcl @@ -0,0 +1,42 @@ +# syntax = edrevo/dockerfile-plus + +INCLUDE+ Dockerfile.ros-ubuntu:20.04 + +RUN sudo apt-get update && \ + sudo apt-get install -y ros-noetic-pcl-conversions ros-noetic-pcl-ros ros-noetic-octomap-server && \ + sudo rm -rf /var/lib/apt/lists/* + + # remove ros-noetic-moveit-ros-perception / http://repositories.ros.org/status_page/ros_noetic_default.html?q=moveit_ros_perception +RUN sudo apt-get update && \ + sudo apt-get install -y ros-noetic-rviz ros-noetic-robot-self-filter && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y libopencv-dev liblapack-dev && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo apt-get update && \ + sudo apt-get install -y emacs cython && \ + sudo rm -rf /var/lib/apt/lists/* + +# image_view +RUN sudo apt-get update && \ + rosdep update --include-eol-distros && \ + rosdep resolve gtk2 | sed -e "s/^#.*//g" | xargs sudo apt-get install -y && \ + sudo rm -rf /var/lib/apt/lists/* +# RUN rosdep resolve python-qt-bindings | sed -e "s/^#.*//g" | xargs sudo apt-get install -y # qt_gui_core + +# fix latest pip install fcn errors +RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python -; sudo -H pip install 'pip<10' +RUN sudo pip install fcn chainercv chainer==6.7.0 cupy-cuda91 decorator==4.4.2 + +# install common package to speedup +RUN sudo pip install freezegun +RUN sudo apt-get update && \ + sudo apt-get install -y libshiboken2-dev shiboken2 \ + python3-pyside2.qtgui \ + ros-noetic-rqt-reconfigure python3-matplotlib imagemagick \ + ros-noetic-pcl-msgs ros-noetic-octomap-msgs && \ + sudo rm -rf /var/lib/apt/lists/* + +ARG CACHEBUST=1 +RUN echo $CACHBUST +RUN sudo apt-get update && sudo apt-get dist-upgrade -y && sudo rm -rf /var/lib/apt/lists/* diff --git a/.travis/docker/Makefile b/.travis/docker/Makefile index b5354df..84e69fa 100644 --- a/.travis/docker/Makefile +++ b/.travis/docker/Makefile @@ -1,56 +1,71 @@ -all: 12.04-base 14.04-base 14.04-base 18.04-base \ - 14.04-pcl 16.04-pcl 18.04-pcl \ +DOCKER_BUILD_ARGS=--build-arg CACHEBUST=$(shell date +%Y%m%d) + +all: 12.04-base 14.04-base 14.04-base 18.04-base 20.04-base \ + 14.04-pcl 16.04-pcl 18.04-pcl 20.04-pcl \ 14.04-pcl1.8 12.04-base: 12.04 Dockerfile.ros-ubuntu\:12.04-base echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 12.04: Dockerfile.ros-ubuntu\:12.04 echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 14.04-pcl1.8: 14.04 Dockerfile.ros-ubuntu\:14.04-pcl1.8 echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 14.04-pcl: 14.04 Dockerfile.ros-ubuntu\:14.04-pcl echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 14.04-base: 14.04 Dockerfile.ros-ubuntu\:14.04-base echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 14.04: Dockerfile.ros-ubuntu\:14.04 echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 16.04-pcl: 16.04 Dockerfile.ros-ubuntu\:16.04-pcl echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 16.04-base: 16.04 Dockerfile.ros-ubuntu\:16.04-base echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 16.04: Dockerfile.ros-ubuntu\:16.04 echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 18.04-pcl: 18.04 Dockerfile.ros-ubuntu\:18.04-pcl echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 18.04-base: 18.04 Dockerfile.ros-ubuntu\:18.04-base echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . 18.04: Dockerfile.ros-ubuntu\:18.04 echo "Building $@" - docker build -t ros-ubuntu:$@ --build-arg CACHEBUST=$(shell date +%Y%m%d) -f Dockerfile.ros-ubuntu:$@ . + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . + +20.04-pcl: 20.04 Dockerfile.ros-ubuntu\:20.04-pcl + echo "Building $@" + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . + +20.04-base: 20.04 Dockerfile.ros-ubuntu\:20.04-base + echo "Building $@" + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . + +20.04: Dockerfile.ros-ubuntu\:20.04 + echo "Building $@" + DOCKER_BUILDKIT=1 docker build -t ros-ubuntu:$@ $(DOCKER_BUILD_ARGS) -f Dockerfile.ros-ubuntu:$@ . .PHONY: Dockerfile.ros-ubuntu\:12.04 Dockerfile.ros-ubuntu\:12.04-base \ Dockerfile.ros-ubuntu\:14.04 Dockerfile.ros-ubuntu\:14.04-base Dockerfile.ros-ubuntu\:14.04-pcl Dockerfile.ros-ubuntu\:14.04-pcl1.8 \ Dockerfile.ros-ubuntu\:16.04 Dockerfile.ros-ubuntu\:16.04-base Dockerfile.ros-ubuntu\:16.04-pcl \ - Dockerfile.ros-ubuntu\:18.04 Dockerfile.ros-ubuntu\:18.04-base Dockerfile.ros-ubuntu\:18.04-pcl + Dockerfile.ros-ubuntu\:18.04 Dockerfile.ros-ubuntu\:18.04-base Dockerfile.ros-ubuntu\:18.04-pcl \ + Dockerfile.ros-ubuntu\:20.04 Dockerfile.ros-ubuntu\:20.04-base Dockerfile.ros-ubuntu\:20.04-pcl diff --git a/.travis/docker/hooks/build b/.travis/docker/hooks/build new file mode 100644 index 0000000..0a41a3b --- /dev/null +++ b/.travis/docker/hooks/build @@ -0,0 +1,3 @@ +#!/bin/bash + +DOCKER_BUILDKIT=1 docker build -f $DOCKERFILE_PATH -t $IMAGE_NAME . diff --git a/.travis/package.xml b/.travis/package.xml index 3ceb4ae..49f162d 100644 --- a/.travis/package.xml +++ b/.travis/package.xml @@ -1,6 +1,10 @@ - + + + jsk_travis - 0.5.7 + 0.5.25 jsk_travis scripts BSD Kei Okada @@ -8,7 +12,14 @@ catkin - python + python-gdown-pip + + python + python3 + python-scipy + python3-scipy + python-lxml + python3-lxml catkin rostest rospy_tutorials @@ -16,9 +27,9 @@ gazebo_plugins - python-chainer-pip - python-chainercv-pip - python-fcn-pip + python-chainer-pip + python-chainercv-pip + python-fcn-pip diff --git a/.travis/rosdep-install.sh b/.travis/rosdep-install.sh index 08b591c..130edd3 100755 --- a/.travis/rosdep-install.sh +++ b/.travis/rosdep-install.sh @@ -2,6 +2,11 @@ trap 'find -L . -name manifest.xml.deprecated | xargs -n 1 -i dirname {} | xargs -n 1 -i mv `pwd`/{}/manifest.xml.deprecated `pwd`/{}/manifest.xml' 1 2 3 15 +# for indigo, move package.xml to package.xml.org and remove condition +if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade" ]]; then + find -L . -iname package.xml -exec grep -l package\ format=\"3\" {} \; | xargs -n 1 -i cp {} {}.org + find -L . -iname package.xml -exec grep -l package\ format=\"3\" {} \; | xargs -n 1 -i sed -i 's/_depend condition="\$ROS_PYTHON_VERSION\s*==\s*2">/_depend>/' {} +fi find -L . -name package.xml -exec dirname {} \; | xargs -n 1 -i find {} -name manifest.xml | xargs -n 1 -i mv {} {}.deprecated # rename manifest.xml for rosdep install PACKAGE_PATH_LIST=(${ROS_PACKAGE_PATH//:/\ /}) ROS_PACKAGE_PATH_REVERSED=`for ((i=${#PACKAGE_PATH_LIST[@]}-1; i>=0; i--)); do if [ -e ${PACKAGE_PATH_LIST[$i]} ]; then echo -n ${PACKAGE_PATH_LIST[$i]}' '; fi; done` @@ -19,6 +24,9 @@ if [ $EXIT_STATUS != 0 ]; then fi find -L . -name manifest.xml.deprecated | xargs -n 1 -i dirname {} | xargs -n 1 -i mv `pwd`/{}/manifest.xml.deprecated `pwd`/{}/manifest.xml +if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade" ]]; then + find -L . -iname package.xml.org -exec grep -l package\ format=\"3\" {} \; | xargs -n 1 -i cp {}.org {} +fi #if -r is included in ROSDEP_ADDITIONAL_OPTIONS, always returns true [[ "$ROSDEP_ADDITIONAL_OPTIONS" =~ " -r " ]] && exit 0 diff --git a/.travis/test/test_env_var.py b/.travis/test/test_env_var.py index 20a9ca8..1c8c8e0 100755 --- a/.travis/test/test_env_var.py +++ b/.travis/test/test_env_var.py @@ -1,7 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import print_function + import os +import sys import unittest @@ -9,6 +12,8 @@ class TestEnvVar(unittest.TestCase): def test_env_var(self): + print("TEST_VAR1 : " + os.getenv('TEST_VAR1', ''), file=sys.stderr) + print("TEST_VAR2 : " + os.getenv('TEST_VAR2', ''), file=sys.stderr) self.assertTrue(os.getenv('TEST_VAR1', '') == 'true') self.assertTrue(os.getenv('TEST_VAR2', '') == 'false') diff --git a/.travis/test/test_lxml.py b/.travis/test/test_lxml.py new file mode 100755 index 0000000..32dcf10 --- /dev/null +++ b/.travis/test/test_lxml.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function + +import sys +import unittest + +class TestLexml(unittest.TestCase): + + def test_lxml(self): + + import lxml + print(lxml) + self.assertTrue('true') + +if __name__ == '__main__': + unittest.main() diff --git a/.travis/test/test_scipy.py b/.travis/test/test_scipy.py new file mode 100755 index 0000000..7a49316 --- /dev/null +++ b/.travis/test/test_scipy.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import print_function + +import sys +import unittest +import scipy + +class TestNumpy(unittest.TestCase): + + def test_numpy(self): + + print("NumPy : " + scipy.version.full_version, file=sys.stderr) + print("Python: " + sys.version, file=sys.stderr) + self.assertTrue('true') + +if __name__ == '__main__': + unittest.main() diff --git a/.travis/travis.sh b/.travis/travis.sh index 15af291..becf753 100755 --- a/.travis/travis.sh +++ b/.travis/travis.sh @@ -1,27 +1,6 @@ #!/bin/bash -set -x - -function travis_time_start { - set +x - TRAVIS_START_TIME=$(date +%s%N) - TRAVIS_TIME_ID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 8 | head -n 1) - TRAVIS_FOLD_NAME=$1 - echo -e "${ANSI_CLEAR}traivs_fold:start:$TRAVIS_FOLD_NAME" - echo -e "${ANSI_CLEAR}traivs_time:start:$TRAVIS_TIME_ID${ANSI_BLUE}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${ANSI_RESET}" - set -x -} -function travis_time_end { - set +x - _COLOR=${1:-32} - TRAVIS_END_TIME=$(date +%s%N) - TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME)/1000000000 )) - echo -e "traivs_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n${ANSI_CLEAR}" - echo -e "traivs_fold:end:$TRAVIS_FOLD_NAME\e[${_COLOR}m<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<${ANSI_RESET}" - echo -e "${ANSI_CLEAR}\e[${_COLOR}mFunction $TRAVIS_FOLD_NAME takes $(( $TIME_ELAPSED_SECONDS / 60 )) min $(( $TIME_ELAPSED_SECONDS % 60 )) sec${ANSI_RESET}" - set -x -} - +. $(dirname "${BASH_SOURCE[0]}")/travis_utils.sh echo "Running jsk_travis/travis.sh whose version is $(cd .travis && git describe --all)." @@ -56,9 +35,6 @@ if [ "$(git diff origin/master HEAD $CI_SOURCE_PATH/.travis)" != "" ] ; then fi fi -travis_time_end - - # set default values to env variables [ "${USE_TRAVIS// }" = "" ] && USE_TRAVIS=false @@ -66,6 +42,8 @@ travis_time_end [ ! -z $BUILDER ] && [ "$BUILDER" != catkin ] && ( echo "ERROR: $BUILDER is not supported. BUILDER env is deprecated and only 'catkin' is supported for the build."; exit 1; ) [ ! -z $ROSWS ] && [ "$ROSWS" != wstool ] && ( echo "ERROR: $ROSWS is not supported. ROSWS env is deprecated and only 'wstool' is supported for workspace management."; exit 1; ) +travis_time_end + # docker on travis if [ "$USE_DOCKER" = true ]; then if [ "$DOCKER_IMAGE" = "" ]; then @@ -74,6 +52,7 @@ if [ "$USE_DOCKER" = true ]; then indigo|jade) DISTRO=trusty;; kinetic|lunar) DISTRO=xenial;; melodic) DISTRO=bionic;; + noetic) DISTRO=focal;; *) DISTRO=trusty;; esac export DOCKER_IMAGE=ubuntu:$DISTRO @@ -85,7 +64,11 @@ if [ "$USE_DOCKER" = true ]; then sudo apt-get update && sudo apt-get install -y apt-cacher-ng sudo sed -i "s@CacheDir: /var/cache/apt-cacher-ng@CacheDir: $HOME/apt-cacher-ng@" /etc/apt-cacher-ng/acng.conf grep CacheDir /etc/apt-cacher-ng/acng.conf - sudo chmod 777 $HOME/apt-cacher-ng && sudo /etc/init.d/apt-cacher-ng restart + # need the writable the permissions of $HOME/apt-cacher-ng + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772489 + sudo chown apt-cacher-ng:apt-cacher-ng $HOME/apt-cacher-ng + ls -al $HOME/apt-cacher-ng + sudo chmod a+rwx -R $HOME && sudo /etc/init.d/apt-cacher-ng restart ls -al /var/cache/apt-cacher-ng ls -al /var/cache/apt-cacher-ng/ ls -al $HOME/apt-cacher-ng @@ -132,34 +115,43 @@ if [ "$USE_DOCKER" = true ]; then docker run -v $HOME:$HOME -v $HOME/.ccache:$HOME/.ccache/ -v $HOME/.cache/pip:$HOME/.cache/pip/ \ $DOCKER_XSERVER_OPTIONS \ -e TRAVIS_BRANCH -e TRAVIS_COMMIT -e TRAVIS_JOB_ID -e TRAVIS_OS_NAME -e TRAVIS_PULL_REQUEST -e TRAVIS_REPO_SLUG \ + -e GITHUB_RUN_ID \ -e CI_SOURCE_PATH -e HOME -e REPOSITORY_NAME \ -e BUILD_PKGS -e TARGET_PKGS -e TEST_PKGS \ -e BEFORE_SCRIPT -e BUILDER -e EXTRA_DEB -e USE_DEB \ -e ROS_DISTRO -e ROS_LOG_DIR -e ROS_REPOSITORY_PATH -e ROSWS \ -e CATKIN_TOOLS_BUILD_OPTIONS -e CATKIN_TOOLS_CONFIG_OPTIONS \ -e CATKIN_PARALLEL_JOBS -e CATKIN_PARALLEL_TEST_JOBS \ - -e ROS_PARALLEL_JOBS -e ROS_PARALLEL_TEST_JOBS \ + -e ROS_PARALLEL_JOBS -e ROS_PARALLEL_TEST_JOBS -e ROS_PYTHON_VERSION \ -e ROSDEP_ADDITIONAL_OPTIONS -e ROSDEP_UPDATE_QUIET \ -e SUDO_PIP -e USE_PYTHON_VIRTUALENV \ - -e NOT_TEST_INSTALL \ + -e NOT_TEST_INSTALL -e DEBUG_TRAVIS_PYTHON \ --env-file $DOCKER_ENV_FILE \ -t $DOCKER_IMAGE bash -c 'cd $CI_SOURCE_PATH; .travis/docker.sh' DOCKER_EXIT_CODE=$? + + travis_time_start show_cache rm $DOCKER_ENV_FILE sudo chown -R travis.travis $HOME/apt-cacher-ng # sudo tail -n 100 /var/log/apt-cacher-ng/* # sudo find $HOME/apt-cacher-ng # sudo find /var/cache/apt-cacher-ng sudo chown -R travis.travis $HOME - find $HOME/.ccache -type f - find $HOME/.cache/pip -type f - return $DOCKER_EXIT_CODE + # find $HOME/.ccache -type f + find $HOME/.cache/pip -type f | grep whl || echo "OK" + travis_time_end + exit $DOCKER_EXIT_CODE fi if [ "$USE_TRAVIS" != "true" ] && [ "$ROS_DISTRO" != "hydro" -o "${USE_JENKINS}" == "true" ] && [ "$TRAVIS_JOB_ID" ]; then - pip install --user -U python-jenkins==1.4.0 -q - ./.travis/travis_jenkins.py - return $? + if [ "${DEBUG_TRAVIS_PYTHON}" != "" ]; then + pip --version + python --version + fi + pip install -U python-jenkins==1.7.0 -q + PYTHONIOENCODING=utf-8 ${DEBUG_TRAVIS_PYTHON} ./.travis/travis_jenkins.py + JENKINS_EXIT_CODE=$? + exit $JENKINS_EXIT_CODE fi function error { @@ -171,11 +163,12 @@ function error { trap error ERR -travis_time_start setup_ros +travis_time_start setup_config # Define some config vars export CI_SOURCE_PATH=$(pwd) export REPOSITORY_NAME=${PWD##*/} +export ROS_PYTHON_VERSION_ORIG=${ROS_PYTHON_VERSION} if [ ! "$ROS_PARALLEL_JOBS" ]; then export ROS_PARALLEL_JOBS="-j8"; fi if [ ! "$CATKIN_PARALLEL_JOBS" ]; then export CATKIN_PARALLEL_JOBS="-p4"; fi if [ ! "$ROS_PARALLEL_TEST_JOBS" ]; then export ROS_PARALLEL_TEST_JOBS="$ROS_PARALLEL_JOBS"; fi @@ -184,15 +177,48 @@ if [ ! "$ROS_REPOSITORY_PATH" ]; then export ROS_REPOSITORY_PATH="http://package if [ ! "$ROSDEP_ADDITIONAL_OPTIONS" ]; then export ROSDEP_ADDITIONAL_OPTIONS="-n -q -r --ignore-src"; fi echo "Testing branch $TRAVIS_BRANCH of $REPOSITORY_NAME" +travis_time_end +travis_time_start setup_pip + +# set non interactive tzdata https://stackoverflow.com/questions/8671308/non-interactive-method-for-dpkg-reconfigure-tzdata +# set DEBIAN_FRONTEND=noninteractive +echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections + +# install add-apt-repository +sudo apt-get update +sudo apt-get install -y -q software-properties-common +if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade" ]]; then + sudo apt-get install -y -q python-software-properties +fi + # Install pip -curl https://bootstrap.pypa.io/get-pip.py | sudo python - +# See https://github.com/pypa/pip/issues/4805 for detail. +# https://github.com/pypa/pypi-support/issues/978 requires Python >= 2.7.9 +if [[ "$ROS_DISTRO" =~ "indigo"|"jade" ]]; then + sudo add-apt-repository -y ppa:longsleep/python2.7-backports + sudo apt-get update + sudo apt-get dist-upgrade -y +fi +# Note: pip 21.0, in January 2021, will remove Python 2 support +# 12.04's pip does not support install whl +sudo apt-get update -q || echo Ignore error of apt-get update +sudo -E apt-get -y -qq install python python-setuptools +curl https://files.pythonhosted.org/packages/c4/44/e6b8056b6c8f2bfd1445cc9990f478930d8e3459e9dbf5b8e2d2922d64d3/pip-9.0.3.tar.gz --output /tmp/pip-9.0.3.tar.gz +(cd /tmp; tar -xzf pip-9.0.3.tar.gz) +sudo -H python -m easy_install /tmp/pip-9.0.3 +if [[ ! "$ROS_DISTRO" =~ "hydro" ]]; then # on hydro: Could not find a version that satisfies the requirement pip<10 (from versions: ) + sudo pip install -I 'pip<10' # on melodic reinsall pip9.0.3, otherwise it fails on, ImportError: Entry point ('console_scripts', 'pip2') not found +fi + +hash -r +pip --version || echo "pip is not installed" +python --version || echo "python is not installed" # pip>=10 no longer uninstalls distutils packages (ex. packages installed via apt), # and fails to install packages via pip if they are already installed via apt. -# See https://github.com/pypa/pip/issues/4805 for detail. -sudo -H pip install 'pip<10' -# set DEBIAN_FRONTEND=noninteractive -echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections +travis_time_end +travis_time_start setup_ros + # Setup apt sudo -E sh -c 'echo "deb $ROS_REPOSITORY_PATH `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list' wget http://packages.ros.org/ros.key -O - | sudo apt-key add - @@ -210,7 +236,9 @@ if [[ "$ROS_DISTRO" == "hydro" ]]; then sudo apt-get install -y --force-yes -q python-vcstools=0.1.40-1 sudo apt-mark hold python-vcstools fi -sudo apt-get install -y --force-yes -q -qq python-rosdep python-wstool python-catkin-tools ros-$ROS_DISTRO-rosbash ros-$ROS_DISTRO-rospack ccache pv +# noetic uses python3-rosdep +sudo apt-get install -y --force-yes -q -qq python-rosdep python-wstool python-catkin-tools || (sudo apt-get install -y --force-yes -q -qq python3-rosdep python3-wstool; sudo pip install catkin-tools) +sudo apt-get install -y --force-yes -q -qq ros-$ROS_DISTRO-rosbash ros-$ROS_DISTRO-rospack ccache pv # setup catkin-tools option if [ ! "$CATKIN_TOOLS_BUILD_OPTIONS" ]; then @@ -221,6 +249,10 @@ if [ ! "$CATKIN_TOOLS_BUILD_OPTIONS" ]; then export CATKIN_TOOLS_BUILD_OPTIONS="--summarize --no-status" fi fi + +travis_time_end +travis_time_start setup_cache + # setup ccache sudo ln -s /usr/bin/ccache /usr/local/bin/gcc sudo ln -s /usr/bin/ccache /usr/local/bin/g++ @@ -228,6 +260,20 @@ sudo ln -s /usr/bin/ccache /usr/local/bin/cc sudo ln -s /usr/bin/ccache /usr/local/bin/c++ ccache -s +travis_time_end +travis_time_start setup_git + +# check git : old linux needs newer git client ? +# https://stackoverflow.com/questions/53207973/fatal-unknown-value-for-config-protocol-version-2 +sudo add-apt-repository -y ppa:git-core/ppa +sudo apt-get update +sudo apt-get install -y -q git +git --version +git config -l + +travis_time_end +travis_time_start setup_mongo + if [ "$EXTRA_DEB" ]; then sudo apt-get install -q -qq -y $EXTRA_DEB; fi # MongoDB hack - I don't fully understand this but its for moveit_warehouse dpkg -s mongodb || echo "ok"; export HAVE_MONGO_DB=$? @@ -245,6 +291,13 @@ rosdep --version if [ ! -e /etc/ros/rosdep/sources.list.d/20-default.list ]; then sudo rosdep init fi + +# use snapshot of rosdep list +# https://github.com/ros/rosdistro/pull/31570#issuecomment-1000497517 +if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade"|"kinetic"|"lunar" ]]; then + sudo rm /etc/ros/rosdep/sources.list.d/20-default.list + sudo wget https://gist.githubusercontent.com/cottsay/b27a46e53b8f7453bf9ff637d32ea283/raw/476b3714bb90cfbc6b8b9d068162fc6408fa7f76/30-xenial.list -O /etc/ros/rosdep/sources.list.d/30-xenial.list +fi ret=1 rosdep update --include-eol-distros|| while [ $ret != 0 ]; do sleep 1; rosdep update --include-eol-distros && ret=0 || echo "failed"; done @@ -260,10 +313,12 @@ else fi sudo apt-get install -y --force-yes -q -qq ros-$ROS_DISTRO-roslaunch ### https://github.com/ros/ros_comm/pull/641 -(cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/641.diff -O /tmp/641.diff; [ "$ROS_DISTRO" == "hydro" ] && sed -i s@items@iteritems@ /tmp/641.diff ; sudo patch -p4 < /tmp/641.diff) - +if [[ "$ROS_DISTRO" =~ "hydro"|"indigo"|"jade"|"kinetic"|"lunar"|"melodic" ]]; then + (cd /opt/ros/$ROS_DISTRO/lib/python2.7/dist-packages; wget --no-check-certificate https://patch-diff.githubusercontent.com/raw/ros/ros_comm/pull/641.diff -O /tmp/641.diff; if [[ "$ROS_DISTRO" == "hydro" ]]; then sed -i s@items@iteritems@ /tmp/641.diff ; fi; sudo patch -p4 < /tmp/641.diff) +fi travis_time_end +set -x # Check ROS tool's version echo -e "\e[0KROS tool's version" @@ -291,6 +346,9 @@ if [ "$USE_DEB" == false ]; then # install (maybe unreleased version) dependencies from source for specific ros version wstool merge --merge-replace -y file://$CI_SOURCE_PATH/.travis.rosinstall.$ROS_DISTRO fi + # since https://github.blog/2021-09-01-improving-git-protocol-security-github/ we can not use git:// + # we need to remove git:// from submodules and run wstool update again + wstool update || find -iname .gitmodules -exec cat {} \; -exec sed -i s@git://github@https://github@ {} \; -exec sh -c 'cd $(dirname "$1"); git submodule sync;' sh {} \; -exec cat {} \; wstool update fi ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace @@ -305,6 +363,7 @@ if [ "$ROSDEP_UPDATE_QUIET" == "true" ]; then ROSDEP_ARGS=>/dev/null fi source /opt/ros/$ROS_DISTRO/setup.bash > /tmp/$$.x 2>&1; grep export\ [^_] /tmp/$$.x # ROS_PACKAGE_PATH is important for rosdep +if [ "${ROS_PYTHON_VERSION_ORIG}" != "" ]; then export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION_ORIG}; fi travis_time_end @@ -312,6 +371,7 @@ travis_time_start before_script ### before_script: # Use this to prepare your build for testing e.g. copy database configurations, environment variables, etc. source /opt/ros/$ROS_DISTRO/setup.bash > /tmp/$$.x 2>&1; grep export\ [^_] /tmp/$$.x # re-source setup.bash for setting environmet vairable for package installed via rosdep +if [ "${ROS_PYTHON_VERSION_ORIG}" != "" ]; then export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION_ORIG}; fi if [ "${BEFORE_SCRIPT// }" != "" ]; then sh -c "${BEFORE_SCRIPT}"; fi travis_time_end @@ -323,6 +383,8 @@ travis_time_start setup_pip_cache if [ `whoami` = travis ]; then sudo rm -fr /root/.cache/pip sudo cp -r $HOME/.cache/pip /root/.cache/ + sudo ls -al /root/.cache/ + sudo mkdir -p /root/.cache/pip/ sudo chown -R root:root /root/.cache/pip/ fi # Show cached PIP packages @@ -350,6 +412,7 @@ sudo find -L /root/.cache/ | grep whl || echo "OK" sudo find -L $HOME/.cache/ | grep whl || echo "OK" travis_time_end +set -x wstool --version wstool info -t . @@ -359,11 +422,13 @@ travis_time_start catkin_build ### script: # All commands must exit with code 0 on success. Anything else is considered failure. source /opt/ros/$ROS_DISTRO/setup.bash > /tmp/$$.x 2>&1; grep export\ [^_] /tmp/$$.x # re-source setup.bash for setting environmet vairable for package installed via rosdep +if [ "${ROS_PYTHON_VERSION_ORIG}" != "" ]; then export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION_ORIG}; fi + # for catkin if [ "${TARGET_PKGS// }" == "" ]; then export TARGET_PKGS=`catkin_topological_order ${CI_SOURCE_PATH} --only-names`; fi if [ "${TEST_PKGS// }" == "" ]; then export TEST_PKGS=$( [ "${BUILD_PKGS// }" == "" ] && echo "$TARGET_PKGS" || echo "$BUILD_PKGS"); fi -if [ -z $TRAVIS_JOB_ID ]; then - # on Jenkins +if [ -z $TRAVIS_JOB_ID ] || [ ! -z $GITHUB_RUN_ID ] ; then + # on Jenkins or GithubAction catkin build $CATKIN_TOOLS_BUILD_OPTIONS $BUILD_PKGS $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS -- else # on Travis, the command must outputs log within 10 min to avoid failures, so the `travis_wait` is necessary. @@ -381,14 +446,16 @@ if [ "$ROS_DISTRO" == "hydro" ]; then fi source devel/setup.bash > /tmp/$$.x 2>&1; grep export\ [^_] /tmp/$$.x ; rospack profile # force to update ROS_PACKAGE_PATH for rostest +if [ "${ROS_PYTHON_VERSION_ORIG}" != "" ]; then export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION_ORIG}; fi + # set -Werror=dev for developer errors (supported only fo kinetic and above) if [[ "$ROS_DISTRO" > "indigo" ]] && [[ "$CMAKE_DEVELOPER_ERROR" == "true" ]]; then CMAKE_ARGS_FLAGS="--cmake-args -Werror=dev" else CMAKE_ARGS_FLAGS="" fi -if [ -z $TRAVIS_JOB_ID ]; then - # on Jenkins +if [ -z $TRAVIS_JOB_ID ] || [ ! -z $GITHUB_RUN_ID ] ; then + # on Jenkins or GithubAction # suppressing the output # - https://github.com/catkin/catkin_tools/issues/405 # - https://github.com/ros-planning/moveit_ci/pull/18 @@ -402,9 +469,16 @@ else #travis_wait 60 catkin run_tests -i --no-deps --no-status $TEST_PKGS $CATKIN_PARALLEL_TEST_JOBS --make-args $ROS_PARALLEL_TEST_JOBS $CMAKE_ARGS_FLAGS -- travis_wait 60 catkin build --catkin-make-args run_tests -- -i --no-deps --no-status $TEST_PKGS $CATKIN_PARALLEL_TEST_JOBS --make-args $ROS_PARALLEL_TEST_JOBS $CMAKE_ARGS_FLAGS -- fi + +travis_time_end +travis_time_start catkin_test_results + catkin_test_results --verbose --all build || error travis_time_end +set -x + +catkin_test_results build || echo "OK" if [ "$NOT_TEST_INSTALL" != "true" ]; then @@ -412,14 +486,16 @@ if [ "$NOT_TEST_INSTALL" != "true" ]; then catkin clean --yes || catkin clean -a # 0.3.1 uses -a, 0.4.0 uses --yes catkin config --install $CATKIN_TOOLS_CONFIG_OPTIONS - if [ -z $TRAVIS_JOB_ID ]; then - # on Jenkins + if [ -z $TRAVIS_JOB_ID ] || [ ! -z $GITHUB_RUN_ID ] ; then + # on Jenkins or GithubAction catkin build $CATKIN_TOOLS_BUILD_OPTIONS $BUILD_PKGS $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS -- else # on Travis travis_wait 60 catkin build $CATKIN_TOOLS_BUILD_OPTIONS $BUILD_PKGS $CATKIN_PARALLEL_JOBS --make-args $ROS_PARALLEL_JOBS -- fi source install/setup.bash > /tmp/$$.x 2>&1; grep export\ [^_] /tmp/$$.x + if [ "${ROS_PYTHON_VERSION_ORIG}" != "" ]; then export ROS_PYTHON_VERSION=${ROS_PYTHON_VERSION_ORIG}; fi + rospack profile rospack plugins --attrib=plugin nodelet || echo "ok" diff --git a/.travis/travis_jenkins.py b/.travis/travis_jenkins.py index 8a88dfb..2300cf1 100755 --- a/.travis/travis_jenkins.py +++ b/.travis/travis_jenkins.py @@ -1,16 +1,22 @@ #!/usr/bin/env python +from __future__ import print_function # need pip installed version of python-jenkins > 0.4.0 import jenkins import requests import urllib -import urllib2 +try: + import urllib2 +except: + import urllib.request, urllib.error import json import time import os import re import sys +import random +import string from os import environ as env @@ -36,7 +42,12 @@ - TRAVIS_JENKINS_UNIQUE_ID + TRAVIS_BRANCH + + + + + TRAVIS_COMMIT @@ -46,7 +57,167 @@ - TRAVIS_COMMIT + TRAVIS_REPO_SLUG + + + + + TRAVIS_BUILD_ID + + + + + TRAVIS_BUILD_NUMBER + + + + + TRAVIS_JOB_ID + + + + + TRAVIS_JOB_NUMBER + + + + + TRAVIS_JENKINS_UNIQUE_ID + + + + + ROS_DISTRO + + + + + USE_DEB + + + + + EXTRA_DEB + + + + + TEST_PKGS + + + + + TARGET_PKGS + + + + + BEFORE_SCRIPT + + + + + NOT_TEST_INSTALL + + + + + ROS_PARALLEL_JOBS + + + + + ROS_PYTHON_VERSION + + + + + CATKIN_PARALLEL_JOBS + + + + + CATKIN_TOOLS_BUILD_OPTIONS + + + + + CATKIN_TOOLS_CONFIG_OPTIONS + + + + + ROS_PARALLEL_TEST_JOBS + + + + + CATKIN_PARALLEL_TEST_JOBS + + + + + CMAKE_DEVELOPER_ERROR + + + + + BUILD_PKGS + + + + + ROS_REPOSITORY_PATH + + + + + ROSDEP_ADDITIONAL_OPTIONS + + + + + DOCKER_CONTAINER_NAME + + + + + DOCKER_RUN_OPTION + + + + + NUMBER_OF_LOGS_TO_KEEP + + + + + REPOSITORY_NAME + + + + + TRAVIS_BUILD_WEB_URL + + + + + TRAVIS_JOB_WEB_URL + + + + + DOCKER_IMAGE_JENKINS + + + + + TIMEOUT_JENKINS + + 120 + + + ADD_ENV_VALUE_TO_DOCKER @@ -64,21 +235,42 @@ +function travis_time_start { + set +x + TRAVIS_START_TIME=$(date +%%s%%N) + TRAVIS_TIME_ID=$RANDOM + TRAVIS_FOLD_NAME=$1 + echo -e "${ANSI_CLEAR}traivs_fold:start:${TRAVIS_FOLD_NAME}" + echo -e "${ANSI_CLEAR}traivs_time:start:${TRAVIS_TIME_ID}${ANSI_BLUE}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${ANSI_RESET}" + set -x +} +function travis_time_end { + set +x + _COLOR=${1:-32} + TRAVIS_END_TIME=$(date +%%s%%N) + TIME_ELAPSED_SECONDS=$(( (${TRAVIS_END_TIME} - ${TRAVIS_START_TIME})/1000000000 )) + echo -e "traivs_time:end:${TRAVIS_TIME_ID}:start=${TRAVIS_START_TIME},finish=${TRAVIS_END_TIME},duration=$((${TRAVIS_END_TIME} - ${TRAVIS_START_TIME}))\n${ANSI_CLEAR}" + echo -e "traivs_fold:end:${TRAVIS_FOLD_NAME}\e[${_COLOR}m<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<${ANSI_RESET}" + echo -e "${ANSI_CLEAR}\e[${_COLOR}mFunction ${TRAVIS_FOLD_NAME} takes $(( ${TIME_ELAPSED_SECONDS} / 60 )) min $(( ${TIME_ELAPSED_SECONDS} %% 60 )) sec${ANSI_RESET}" +} + +travis_time_start setup_jenkins + set -x set -e env WORKSPACE=`pwd` [ "${BUILD_TAG}" = "" ] && BUILD_TAG="build_tag" # jenkins usually has build_tag environment, note this is sh -trap "pwd; ls -al $WORKSPACE/${BUILD_TAG} || echo 'ok'" EXIT +trap "set +x" EXIT # try git clone until success -until git clone https://github.com/%(TRAVIS_REPO_SLUG)s ${BUILD_TAG}/%(TRAVIS_REPO_SLUG)s +until git clone https://github.com/$TRAVIS_REPO_SLUG ${BUILD_TAG}/$TRAVIS_REPO_SLUG do echo "Retrying" done -cd ${BUILD_TAG}/%(TRAVIS_REPO_SLUG)s +cd ${BUILD_TAG}/$TRAVIS_REPO_SLUG #git fetch -q origin '+refs/pull/*:refs/remotes/pull/*' -#git checkout -qf %(TRAVIS_COMMIT)s || git checkout -qf pull/${TRAVIS_PULL_REQUEST}/head +#git checkout -qf $TRAVIS_COMMIT || git checkout -qf pull/${TRAVIS_PULL_REQUEST}/head if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then git fetch -q origin +refs/pull/${TRAVIS_PULL_REQUEST}/merge git checkout -qf FETCH_HEAD @@ -89,84 +281,128 @@ git submodule init git submodule update -if [ "%(REPOSITORY_NAME)s" = "jsk_travis" ]; then +if [ "$REPOSITORY_NAME" = "jsk_travis" ]; then mkdir .travis; cp -r * .travis # need to copy, since directory starting from . is ignoreed by catkin build fi -# run docker build -docker build -t %(DOCKER_IMAGE_JENKINS)s -f $(echo .travis/docker/Dockerfile.%(DOCKER_IMAGE_JENKINS)s | sed -e s/-[^-]*\$//) .travis/docker -docker build -t %(DOCKER_IMAGE_JENKINS)s --build-arg CACHEBUST=$(date +%%Y%%m%%d) -f .travis/docker/Dockerfile.%(DOCKER_IMAGE_JENKINS)s .travis/docker - -echo "DOCKER_CONTAINER_NAME: %(DOCKER_CONTAINER_NAME)s" -echo "TRAVIS_BRANCH : %(TRAVIS_BRANCH)s" -echo "TRAVIS_COMMIT : %(TRAVIS_COMMIT)s" -echo "TRAVIS_PULL_REQUEST : %(TRAVIS_PULL_REQUEST)s" -echo "TRAVIS_REPO_SLUG : %(TRAVIS_REPO_SLUG)s" -echo "TRAVIS_BUILD_ID : %(TRAVIS_BUILD_ID)s" -echo "TRAVIS_BUILD_NUMBER : %(TRAVIS_BUILD_NUMBER)s" -echo "TRAVIS_JOB_ID : %(TRAVIS_JOB_ID)s" -echo "TRAVIS_JOB_NUMBER : %(TRAVIS_JOB_NUMBER)s" -echo "TRAVIS_JENKINS_UNIQUE_ID : %(TRAVIS_JENKINS_UNIQUE_ID)s" +travis_time_end +# travis_time_start docker_build + +# # run docker build +# docker build -t $DOCKER_IMAGE_JENKINS -f $(echo .travis/docker/Dockerfile.$DOCKER_IMAGE_JENKINS | sed -e s/-[^-]*\$//) .travis/docker +# docker build -t $DOCKER_IMAGE_JENKINS --build-arg CACHEBUST=$(date +%%Y%%m%%d) -f .travis/docker/Dockerfile.$DOCKER_IMAGE_JENKINS .travis/docker + +# travis_time_end +set +x + +echo "DOCKER_CONTAINER_NAME: $DOCKER_CONTAINER_NAME" +echo "TRAVIS_BRANCH : $TRAVIS_BRANCH" +echo "TRAVIS_COMMIT : $TRAVIS_COMMIT" +echo "TRAVIS_PULL_REQUEST : $TRAVIS_PULL_REQUEST" +echo "TRAVIS_REPO_SLUG : $TRAVIS_REPO_SLUG" +echo "TRAVIS_BUILD_ID : $TRAVIS_BUILD_ID" +echo "TRAVIS_BUILD_NUMBER : $TRAVIS_BUILD_NUMBER" +echo "TRAVIS_JOB_ID : $TRAVIS_JOB_ID" +echo "TRAVIS_JOB_NUMBER : $TRAVIS_JOB_NUMBER" +echo "TRAVIS_JENKINS_UNIQUE_ID : $TRAVIS_JENKINS_UNIQUE_ID" +echo "ROS_DISTRO : $ROS_DISTRO" +echo "USE_DEB : $USE_DEB" +echo "EXTRA_DEB : $EXTRA_DEB" +echo "TEST_PKGS : $TEST_PKGS" +echo "TARGET_PKGS : $TARGET_PKGS" +echo "BEFORE_SCRIPT : $BEFORE_SCRIPT" +echo "NOT_TEST_INSTALL : $NOT_TEST_INSTALL" +echo "ROS_PARALLEL_JOBS : $ROS_PARALLEL_JOBS" +echo "ROS_PYTHON_VERSION : $ROS_PYTHON_VERSION" +echo "CATKIN_PARALLEL_JOBS : $CATKIN_PARALLEL_JOBS" +echo "CATKIN_TOOLS_BUILD_OPTIONS : $CATKIN_TOOLS_BUILD_OPTIONS" +echo "CATKIN_TOOLS_CONFIG_OPTIONS : $CATKIN_TOOLS_CONFIG_OPTIONS" +echo "ROS_PARALLEL_TEST_JOBS : $ROS_PARALLEL_TEST_JOBS" +echo "CATKIN_PARALLEL_TEST_JOBS : $CATKIN_PARALLEL_TEST_JOBS" +echo "CMAKE_DEVELOPER_ERROR : $CMAKE_DEVELOPER_ERROR" +echo "BUILD_PKGS : $BUILD_PKGS" +echo "ROS_REPOSITORY_PATH : $ROS_REPOSITORY_PATH" +echo "ROSDEP_ADDITIONAL_OPTIONS : $ROSDEP_ADDITIONAL_OPTIONS" +echo "DOCKER_CONTAINER_NAME : $DOCKER_CONTAINER_NAME" +echo "DOCKER_RUN_OPTION : $DOCKER_RUN_OPTION" +echo "NUMBER_OF_LOGS_TO_KEEP : $NUMBER_OF_LOGS_TO_KEEP" +echo "REPOSITORY_NAME : $REPOSITORY_NAME" +echo "TRAVIS_BUILD_WEB_URL : $TRAVIS_BUILD_WEB_URL" +echo "TRAVIS_JOB_WEB_URL : $TRAVIS_JOB_WEB_URL" +echo "DOCKER_IMAGE_JENKINS : $DOCKER_IMAGE_JENKINS" +echo "TIMEOUT_JENKINS : $TIMEOUT_JENKINS" +echo "ADD_ENV_VALUE_TO_DOCKER : $ADD_ENV_VALUE_TO_DOCKER" + +travis_time_start setup_cache +set -x # run watchdog for kill orphan docker container -.travis/travis_watchdog.py %(DOCKER_CONTAINER_NAME)s & +.travis/travis_watchdog.py $DOCKER_CONTAINER_NAME & # setup cache dir -mkdir -p /data/cache/%(ROS_DISTRO)s/ccache -mkdir -p /data/cache/%(ROS_DISTRO)s/pip-cache -mkdir -p /data/cache/%(ROS_DISTRO)s/ros/data -mkdir -p /data/cache/%(ROS_DISTRO)s/ros/rosdep +mkdir -p /data/cache/$ROS_DISTRO/ccache +mkdir -p /data/cache/$ROS_DISTRO/pip-cache +mkdir -p /data/cache/$ROS_DISTRO/chainer +mkdir -p /data/cache/$ROS_DISTRO/ros/data +mkdir -p /data/cache/$ROS_DISTRO/ros/rosdep # setup docker env-file DOCKER_ENV_FILE="/tmp/docker_env_file_$$" : > $DOCKER_ENV_FILE -if [ "%(ADD_ENV_VALUE_TO_DOCKER)s" != "" ]; then - env_var_list=(`echo "%(ADD_ENV_VALUE_TO_DOCKER)s"`) +if [ "$ADD_ENV_VALUE_TO_DOCKER" != "" ]; then + env_var_list=(`echo "$ADD_ENV_VALUE_TO_DOCKER"`) for env_var in ${env_var_list[@]}; do echo "$env_var" >> $DOCKER_ENV_FILE done fi cat $DOCKER_ENV_FILE +travis_time_end + # docker ps -a -if [ "$(docker ps -a | grep %(DOCKER_CONTAINER_NAME)s || true)" ] ; then - echo "Reanaming docker container name to %(DOCKER_CONTAINER_NAME)s_%(TRAVIS_JENKINS_UNIQUE_ID)s" - docker rename %(DOCKER_CONTAINER_NAME)s %(DOCKER_CONTAINER_NAME)s_%(TRAVIS_JENKINS_UNIQUE_ID)s +if [ "$(docker ps -a | grep $DOCKER_CONTAINER_NAME || true)" ] ; then + echo "Reanaming docker container name to $DOCKER_CONTAINER_NAME_$TRAVIS_JENKINS_UNIQUE_ID" + docker rename $DOCKER_CONTAINER_NAME $DOCKER_CONTAINER_NAME_$TRAVIS_JENKINS_UNIQUE_ID fi -docker run %(DOCKER_RUN_OPTION)s \\ - --name %(DOCKER_CONTAINER_NAME)s \\ - -e ROS_DISTRO='%(ROS_DISTRO)s' \\ - -e USE_DEB='%(USE_DEB)s' \\ - -e TRAVIS_REPO_SLUG='%(TRAVIS_REPO_SLUG)s' \\ - -e EXTRA_DEB='%(EXTRA_DEB)s' \\ - -e TARGET_PKGS='%(TARGET_PKGS)s' \\ - -e BEFORE_SCRIPT='%(BEFORE_SCRIPT)s' \\ - -e TEST_PKGS='%(TEST_PKGS)s' \\ - -e NOT_TEST_INSTALL='%(NOT_TEST_INSTALL)s' \\ - -e ROS_PARALLEL_JOBS='%(ROS_PARALLEL_JOBS)s' \\ - -e CATKIN_PARALLEL_JOBS='%(CATKIN_PARALLEL_JOBS)s' \\ - -e CATKIN_TOOLS_BUILD_OPTIONS='%(CATKIN_TOOLS_BUILD_OPTIONS)s' \\ - -e CATKIN_TOOLS_CONFIG_OPTIONS='%(CATKIN_TOOLS_CONFIG_OPTIONS)s' \\ - -e ROS_PARALLEL_TEST_JOBS='%(ROS_PARALLEL_TEST_JOBS)s' \\ - -e CATKIN_PARALLEL_TEST_JOBS='%(CATKIN_PARALLEL_TEST_JOBS)s' \\ - -e CMAKE_DEVELOPER_ERROR='%(CMAKE_DEVELOPER_ERROR)s' \\ - -e BUILD_PKGS='%(BUILD_PKGS)s' \\ - -e ROS_REPOSITORY_PATH='%(ROS_REPOSITORY_PATH)s' \\ - -e ROSDEP_ADDITIONAL_OPTIONS='%(ROSDEP_ADDITIONAL_OPTIONS)s' \\ - -e DOCKER_RUN_OPTION='%(DOCKER_RUN_OPTION)s' \\ + +travis_time_start docker_run + +docker run $DOCKER_RUN_OPTION \\ + --name $DOCKER_CONTAINER_NAME \\ + -e ROS_DISTRO="$ROS_DISTRO" \\ + -e USE_DEB="$USE_DEB" \\ + -e TRAVIS_REPO_SLUG="$TRAVIS_REPO_SLUG" \\ + -e EXTRA_DEB="$EXTRA_DEB" \\ + -e TARGET_PKGS="$TARGET_PKGS" \\ + -e BEFORE_SCRIPT="$BEFORE_SCRIPT" \\ + -e TEST_PKGS="$TEST_PKGS" \\ + -e NOT_TEST_INSTALL="$NOT_TEST_INSTALL" \\ + -e ROS_PARALLEL_JOBS="$ROS_PARALLEL_JOBS" \\ + -e ROS_PYTHON_VERSION="$ROS_PYTHON_VERSION" \\ + -e CATKIN_PARALLEL_JOBS="$CATKIN_PARALLEL_JOBS" \\ + -e CATKIN_TOOLS_BUILD_OPTIONS="$CATKIN_TOOLS_BUILD_OPTIONS" \\ + -e CATKIN_TOOLS_CONFIG_OPTIONS="$CATKIN_TOOLS_CONFIG_OPTIONS" \\ + -e ROS_PARALLEL_TEST_JOBS="$ROS_PARALLEL_TEST_JOBS" \\ + -e CATKIN_PARALLEL_TEST_JOBS="$CATKIN_PARALLEL_TEST_JOBS" \\ + -e CMAKE_DEVELOPER_ERROR="$CMAKE_DEVELOPER_ERROR" \\ + -e BUILD_PKGS="$BUILD_PKGS" \\ + -e ROS_REPOSITORY_PATH="$ROS_REPOSITORY_PATH" \\ + -e ROSDEP_ADDITIONAL_OPTIONS="$ROSDEP_ADDITIONAL_OPTIONS" \\ + -e DOCKER_RUN_OPTION="$DOCKER_RUN_OPTION" \\ -e HOME=/workspace \\ --env-file $DOCKER_ENV_FILE \\ -v $WORKSPACE/${BUILD_TAG}:/workspace \\ - -v /data/cache/%(ROS_DISTRO)s/ccache:/workspace/.ccache \\ - -v /data/cache/%(ROS_DISTRO)s/pip-cache:/root/.cache/pip \\ - -v /data/cache/%(ROS_DISTRO)s/ros/data:/workspace/.ros/data \\ - -v /data/cache/%(ROS_DISTRO)s/ros/rosdep:/workspace/.ros/rosdep \\ + -v /data/cache/$ROS_DISTRO/ccache:/workspace/.ccache \\ + -v /data/cache/$ROS_DISTRO/pip-cache:/root/.cache/pip \\ + -v /data/cache/$ROS_DISTRO/chainer:/workspace/.chainer \\ + -v /data/cache/$ROS_DISTRO/ros/data:/workspace/.ros/data \\ + -v /data/cache/$ROS_DISTRO/ros/rosdep:/workspace/.ros/rosdep \\ -v /tmp/.X11-unix:/tmp/.X11-unix:rw \\ - -w /workspace %(DOCKER_IMAGE_JENKINS)s /bin/bash \\ + -w /workspace $DOCKER_IMAGE_JENKINS /bin/bash \\ -c "$(cat <<EOL -cd %(TRAVIS_REPO_SLUG)s +cd $TRAVIS_REPO_SLUG set -x trap 'exit 1' ERR env @@ -174,9 +410,13 @@ # setup cache dir sudo chmod -R a+rw /root/.cache/pip sudo chown -R root.root /root/.cache/pip +sudo chown -R user.jenkins /workspace/.chainer sudo chown -R user.jenkins /workspace/.ccache sudo chown -R user.jenkins /workspace/.ros +# check if archive.ubuntu.com is available in this distribution +sudo apt-get -y -qq update || if [ \$? -eq 100 ]; then sudo sed -i 's/archive.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list; fi + # mkdir log dir mkdir log export ROS_LOG_DIR=\$PWD/log @@ -207,7 +447,7 @@ glxinfo | grep GLX || echo "OK" # start testing -`cat .travis/travis.sh` +.travis/travis.sh EOL )" @@ -224,7 +464,7 @@ - 120 + %(TIMEOUT_JENKINS)s @@ -272,16 +512,16 @@ def wait_for_finished(name, number): now = time.time() * 1000 try: info = j.get_build_info(name, number) - except jenkins.NotFoundException, e: + except jenkins.NotFoundException as e: print('ERROR: Jenkins job name={0}, number={1} in server={2}' - 'not found.'.format(name, number, j.server)) + 'not found.'.format(name, number, j.server), file=sys.stderr) break - except jenkins.JenkinsException, e: + except jenkins.JenkinsException as e: print('ERROR: Maybe Jenkins server is down. Please visit {0}' - .format(j.server)) + .format(j.server), file=sys.stderr) break - except Exception, e: - print('ERROR: Unexpected error: {0}'.format(e)) + except Exception as e: + print('ERROR: Unexpected error: {0}'.format(e), file=sys.stderr) break if not info['building']: result = info['result'] @@ -289,7 +529,7 @@ def wait_for_finished(name, number): # update progressbar progress = (now - info['timestamp']) / info['estimatedDuration'] if loop % (display/sleep) == 0: - print info['url'], "building: ", info['building'], "result: ", info['result'], "progress: ", progress + print("{} building {}, result: {}, progress: {}".format(info['url'], info['building'], info['result'], progress), file=sys.stderr) time.sleep(sleep) loop += 1 return result @@ -308,7 +548,7 @@ def wait_for_building(name, number): except: pass if loop % (display/sleep) == 0: - print('wait for {} {}'.format(name, number)) + print('wait for {} {}'.format(name, number), file=sys.stderr) time.sleep(sleep) loop += 1 @@ -321,7 +561,9 @@ def wait_for_building(name, number): TRAVIS_BUILD_NUMBER = env.get('TRAVIS_BUILD_NUMBER') TRAVIS_JOB_ID = env.get('TRAVIS_JOB_ID') TRAVIS_JOB_NUMBER = env.get('TRAVIS_JOB_NUMBER') -TRAVIS_JENKINS_UNIQUE_ID = '{}.{}'.format(TRAVIS_JOB_ID,time.time()) +TRAVIS_JENKINS_UNIQUE_ID = '{}.{}.{}'.format(time.time(),TRAVIS_JOB_ID, + ''.join(random.choice(string.digits) for _ in range(16))) + ROS_DISTRO = env.get('ROS_DISTRO', 'indigo') USE_DEB = env.get('USE_DEB', 'true') EXTRA_DEB = env.get('EXTRA_DEB', '') @@ -330,6 +572,7 @@ def wait_for_building(name, number): BEFORE_SCRIPT = env.get('BEFORE_SCRIPT', '') NOT_TEST_INSTALL = env.get('NOT_TEST_INSTALL', '') ROS_PARALLEL_JOBS = env.get('ROS_PARALLEL_JOBS', '') +ROS_PYTHON_VERSION = env.get('ROS_PYTHON_VERSION', '') CATKIN_PARALLEL_JOBS = env.get('CATKIN_PARALLEL_JOBS', '') CATKIN_TOOLS_BUILD_OPTIONS = env.get('CATKIN_TOOLS_BUILD_OPTIONS', '') CATKIN_TOOLS_CONFIG_OPTIONS = env.get('CATKIN_TOOLS_CONFIG_OPTIONS', '') @@ -366,11 +609,15 @@ def wait_for_building(name, number): elif env.get('ROS_DISTRO') in ['melodic']: LSB_RELEASE = '18.04' UBUNTU_DISTRO = 'bionic' +elif env.get('ROS_DISTRO') in ['noetic']: + LSB_RELEASE = '20.04' + UBUNTU_DISTRO = 'focal' else: LSB_RELEASE = '14.04' UBUNTU_DISTRO = 'trusty' DOCKER_IMAGE_JENKINS = env.get('DOCKER_IMAGE_JENKINS', 'ros-ubuntu:%s-base' % LSB_RELEASE) +TIMEOUT_JENKINS = env.get('TIMEOUT_JENKINS','120') print(''' TRAVIS_BRANCH = %(TRAVIS_BRANCH)s @@ -390,6 +637,7 @@ def wait_for_building(name, number): BEFORE_SCRIPT = %(BEFORE_SCRIPT)s NOT_TEST_INSTALL = %(NOT_TEST_INSTALL)s ROS_PARALLEL_JOBS = %(ROS_PARALLEL_JOBS)s +ROS_PYTHON_VERSION = %(ROS_PYTHON_VERSION)s CATKIN_PARALLEL_JOBS = %(CATKIN_PARALLEL_JOBS)s CATKIN_TOOLS_BUILD_OPTIONS = %(CATKIN_TOOLS_BUILD_OPTIONS)s CATKIN_TOOLS_CONFIG_OPTIONS = %(CATKIN_TOOLS_CONFIG_OPTIONS)s @@ -406,8 +654,9 @@ def wait_for_building(name, number): TRAVIS_BUILD_WEB_URL = %(TRAVIS_BUILD_WEB_URL)s TRAVIS_JOB_WEB_URL = %(TRAVIS_JOB_WEB_URL)s DOCKER_IMAGE_JENKINS = %(DOCKER_IMAGE_JENKINS)s +TIMEOUT_JENKINS = %(TIMEOUT_JENKINS)s ADD_ENV_VALUE_TO_DOCKER = %(ADD_ENV_VALUE_TO_DOCKER)s -''' % locals()) +''' % locals(), file=sys.stderr) ### start here j = Jenkins('http://jenkins.jsk.imi.i.u-tokyo.ac.jp:8080/', 'k-okada', '11402334328fd5a26f0092c1d763f67f52') @@ -416,12 +665,12 @@ def wait_for_building(name, number): if j.get_plugin_info('ansicolor'): ANSICOLOR_PLUGIN_VERSION=j.get_plugin_info('ansicolor')['version'] else: - print('you need to install ansi color plugin') + print('you need to install ansi color plugin', file=sys.stderr) # use timeout plugin if j.get_plugin_info('build-timeout'): TIMEOUT_PLUGIN_VERSION=j.get_plugin_info('build-timeout')['version'] else: - print('you need to install build_timeout plugin') + print('you need to install build_timeout plugin', file=sys.stderr) # set job_name job_name = TRAVIS_REPO_SLUG @@ -440,29 +689,68 @@ def wait_for_building(name, number): while [item for item in j.get_queue_info() if item['task']['name'] == job_name]: time.sleep(10) # reconfigure job +# if this fails, check https://github.com/spinnaker/spinnaker/issues/2067#issuecomment-407708770 j.reconfig_job(job_name, CONFIGURE_XML % locals()) ## get next number and run -queue_number = j.build_job(job_name, {'TRAVIS_JENKINS_UNIQUE_ID':TRAVIS_JENKINS_UNIQUE_ID, 'TRAVIS_PULL_REQUEST':TRAVIS_PULL_REQUEST, 'TRAVIS_COMMIT':TRAVIS_COMMIT}) +queue_number = j.build_job(job_name, { + 'TRAVIS_BRANCH':TRAVIS_BRANCH, + 'TRAVIS_COMMIT':TRAVIS_COMMIT, + 'TRAVIS_PULL_REQUEST':TRAVIS_PULL_REQUEST, + 'TRAVIS_REPO_SLUG':TRAVIS_REPO_SLUG, + 'TRAVIS_BUILD_ID':TRAVIS_BUILD_ID, + 'TRAVIS_BUILD_NUMBER':TRAVIS_BUILD_NUMBER, + 'TRAVIS_JOB_ID':TRAVIS_JOB_ID, + 'TRAVIS_JOB_NUMBER':TRAVIS_JOB_NUMBER, + 'TRAVIS_JENKINS_UNIQUE_ID':TRAVIS_JENKINS_UNIQUE_ID, + 'ROS_DISTRO':ROS_DISTRO, + 'USE_DEB':USE_DEB, + 'EXTRA_DEB':EXTRA_DEB, + 'TEST_PKGS':TEST_PKGS, + 'TARGET_PKGS':TARGET_PKGS, + 'BEFORE_SCRIPT':BEFORE_SCRIPT, + 'NOT_TEST_INSTALL':NOT_TEST_INSTALL, + 'ROS_PARALLEL_JOBS':ROS_PARALLEL_JOBS, + 'ROS_PYTHON_VERSION':ROS_PYTHON_VERSION, + 'CATKIN_PARALLEL_JOBS':CATKIN_PARALLEL_JOBS, + 'CATKIN_TOOLS_BUILD_OPTIONS':CATKIN_TOOLS_BUILD_OPTIONS, + 'CATKIN_TOOLS_CONFIG_OPTIONS':CATKIN_TOOLS_CONFIG_OPTIONS, + 'ROS_PARALLEL_TEST_JOBS':ROS_PARALLEL_TEST_JOBS, + 'CATKIN_PARALLEL_TEST_JOBS':CATKIN_PARALLEL_TEST_JOBS, + 'CMAKE_DEVELOPER_ERROR':CMAKE_DEVELOPER_ERROR, + 'BUILD_PKGS':BUILD_PKGS, + 'ROS_REPOSITORY_PATH':ROS_REPOSITORY_PATH, + 'ROSDEP_ADDITIONAL_OPTIONS':ROSDEP_ADDITIONAL_OPTIONS, + 'DOCKER_CONTAINER_NAME':DOCKER_CONTAINER_NAME, + 'DOCKER_RUN_OPTION':DOCKER_RUN_OPTION, + 'NUMBER_OF_LOGS_TO_KEEP':NUMBER_OF_LOGS_TO_KEEP, + 'REPOSITORY_NAME':REPOSITORY_NAME, + 'TRAVIS_BUILD_WEB_URL':TRAVIS_BUILD_WEB_URL, + 'TRAVIS_JOB_WEB_URL':TRAVIS_JOB_WEB_URL, + 'DOCKER_IMAGE_JENKINS':DOCKER_IMAGE_JENKINS, + 'TIMEOUT_JENKINS':TIMEOUT_JENKINS, + 'ADD_ENV_VALUE_TO_DOCKER':ADD_ENV_VALUE_TO_DOCKER +}) # wait for queueing while True: message = j.get_queue_item(queue_number)['why'] if message is None: break - print("wait for queueing ... {} ".format(message.encode('utf-8'))) + print("wait for queueing ... {} ".format(message.encode('utf-8')), file=sys.stderr) time.sleep(3) # wait for execution while True: item = j.get_queue_item(queue_number) - if item.has_key('executable'): + if isinstance(item, dict) and 'executable' in item: item = item['executable'] - break; - print("wait for execution....", item) + if isinstance(item, dict) and 'number' in item: + break; + print("wait for execution.... {}".format(item), file=sys.stderr) time.sleep(10) build_number = item['number'] -print('build number is {}'.format(build_number)) +print('build number is {}'.format(build_number), file=sys.stderr) ## configure description if TRAVIS_PULL_REQUEST != 'false': @@ -496,6 +784,7 @@ def wait_for_building(name, number): BEFORE_SCRIPT = %(BEFORE_SCRIPT)s
\ NOT_TEST_INSTALL = %(NOT_TEST_INSTALL)s
\ ROS_PARALLEL_JOBS = %(ROS_PARALLEL_JOBS)s
\ +ROS_PYTHON_VERSION = %(ROS_PYTHON_VERSION)s
\ CATKIN_PARALLEL_JOBS = %(CATKIN_PARALLEL_JOBS)s
\ CATKIN_TOOLS_BUILD_OPTIONS = %(CATKIN_TOOLS_BUILD_OPTIONS)s
\ CATKIN_TOOLS_CONFIG_OPTIONS = %(CATKIN_TOOLS_CONFIG_OPTIONS)s
\ @@ -512,6 +801,7 @@ def wait_for_building(name, number): TRAVIS_BUILD_WEB_URL = %(TRAVIS_BUILD_WEB_URL)s
\ TRAVIS_JOB_WEB_URL = %(TRAVIS_JOB_WEB_URL)s
\ DOCKER_IMAGE_JENKINS = %(DOCKER_IMAGE_JENKINS)s
\ +TIMEOUT_JENKINS = %(TIMEOUT_JENKINS)s
\ ADD_ENV_VALUE_TO_DOCKER = %(ADD_ENV_VALUE_TO_DOCKER)s
\ ') % locals()) @@ -519,10 +809,10 @@ def wait_for_building(name, number): result = wait_for_finished(job_name, build_number) ## show console -print j.get_build_console_output(job_name, build_number) -print "=======================================" -print j.get_build_info(job_name, build_number)['url'] -print "=======================================" +print (u"{}".format(j.get_build_console_output(job_name, build_number)), file=sys.stderr) +print (u"=======================================", file=sys.stderr) +print (u"{}".format(j.get_build_info(job_name, build_number)['url']), file=sys.stderr) +print (u"=======================================", file=sys.stderr) if result == "SUCCESS" : exit(0) else: diff --git a/.travis/travis_utils.sh b/.travis/travis_utils.sh new file mode 100644 index 0000000..c013735 --- /dev/null +++ b/.travis/travis_utils.sh @@ -0,0 +1,104 @@ +# travis related functions (copied from https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh) +export ANSI_RED="\033[31;1m" +export ANSI_GREEN="\033[32;1m" +export ANSI_BLUE="\033[34;1m" +export ANSI_RESET="\033[0m" +export ANSI_CLEAR="\033[0K" + +function travis_time_start { + set +x + TRAVIS_START_TIME=$(date +%s%N) + TRAVIS_TIME_ID=$(printf "%x" $TRAVIS_START_TIME) + TRAVIS_FOLD_NAME=$1 + + if [[ "${GITHUB_ACTIONS}" == "true" ]]; then + echo "::group::$TRAVIS_FOLD_NAME" + else + echo -e "${ANSI_CLEAR}traivs_fold:start:$TRAVIS_FOLD_NAME" + echo -e "${ANSI_CLEAR}traivs_time:start:$TRAVIS_TIME_ID${ANSI_BLUE}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>${ANSI_RESET}" + fi + set -x +} +export -f travis_time_start + +function travis_time_end { + set +x + _COLOR=${1:-32} + TRAVIS_END_TIME=$(date +%s%N) + TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME)/1000000000 )) + if [[ "${GITHUB_ACTIONS}" == "true" ]]; then + echo "::endgroup::" + else + echo -e "traivs_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n${ANSI_CLEAR}" + echo -e "traivs_fold:end:$TRAVIS_FOLD_NAME\e[${_COLOR}m<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<${ANSI_RESET}" + fi + echo -e "${ANSI_CLEAR}\e[${_COLOR}mFunction $TRAVIS_FOLD_NAME takes $(( $TIME_ELAPSED_SECONDS / 60 )) min $(( $TIME_ELAPSED_SECONDS % 60 )) sec${ANSI_RESET}" +} +export -f travis_time_end + +function travis_wait { + set +x + local timeout=$1 + + if [[ $timeout =~ ^[0-9]+$ ]]; then + # looks like an integer, so we assume it's a timeout + shift + else + # default value + timeout=20 + fi + + local cmd="$@" + local log_file=travis_wait_$$.log + + $cmd &>$log_file & + local cmd_pid=$! + + travis_jigger $! $timeout $cmd & + local jigger_pid=$! + local result + + { + wait $cmd_pid 2>/dev/null + result=$? + ps -p$jigger_pid &>/dev/null && kill $jigger_pid + } + + if [ $result -eq 0 ]; then + echo -e "\n${ANSI_GREEN}The command $cmd exited with $result.${ANSI_RESET}" + else + echo -e "\n${ANSI_RED}The command $cmd exited with $result.${ANSI_RESET}" + fi + + echo -e "\n${ANSI_GREEN}Log:${ANSI_RESET}\n" + cat $log_file + + set -x + return $result +} +export -f travis_wait + +function travis_jigger { + # helper method for travis_wait() + local cmd_pid=$1 + shift + local timeout=$1 # in minutes + shift + local count=0 + + # clear the line + echo -e "\n" + + while [ $count -lt $timeout ]; do + count=$(($count + 1)) + echo -ne "Still running ($count of $timeout): $@\r" + sleep 60 + done + + echo -e "\n${ANSI_RED}Timeout (${timeout} minutes) reached. Terminating \"$@\"${ANSI_RESET}\n" + kill -9 $cmd_pid +} +export -f travis_jigger + +# end of travis related functions + diff --git a/jsk_planning/CHANGELOG.rst b/jsk_planning/CHANGELOG.rst index dd21b4f..15e1e1d 100644 --- a/jsk_planning/CHANGELOG.rst +++ b/jsk_planning/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package jsk_planning ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.13 (2023-11-29) +------------------- + 0.1.12 (2020-04-01) ------------------- diff --git a/jsk_planning/package.xml b/jsk_planning/package.xml index a424181..fd1deb6 100644 --- a/jsk_planning/package.xml +++ b/jsk_planning/package.xml @@ -1,7 +1,7 @@ jsk_planning - 0.1.12 + 0.1.13

Metapackage that contains planning package for jsk-ros-pkg

diff --git a/pddl/pddl_msgs/CHANGELOG.rst b/pddl/pddl_msgs/CHANGELOG.rst index 8523bd9..730ab65 100644 --- a/pddl/pddl_msgs/CHANGELOG.rst +++ b/pddl/pddl_msgs/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package pddl_msgs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.13 (2023-11-29) +------------------- + 0.1.12 (2020-04-01) ------------------- * Merge pull request `#70 `_ from furushchev/detail-error diff --git a/pddl/pddl_msgs/package.xml b/pddl/pddl_msgs/package.xml index 0112468..7460a38 100644 --- a/pddl/pddl_msgs/package.xml +++ b/pddl/pddl_msgs/package.xml @@ -1,6 +1,6 @@ pddl_msgs - 0.1.12 + 0.1.13 message for pddl planner Ryohei Ueda diff --git a/pddl/pddl_planner/CHANGELOG.rst b/pddl/pddl_planner/CHANGELOG.rst index 659aa42..d2e7e8c 100644 --- a/pddl/pddl_planner/CHANGELOG.rst +++ b/pddl/pddl_planner/CHANGELOG.rst @@ -2,6 +2,71 @@ Changelog for package pddl_planner ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.13 (2023-11-29) +------------------- +* [pddl_panner/src/eus-pddl.l] support multiple simbols for 'forall and 'exists (`#79 `_) +* add test to reproduce https://github.com/jsk-ros-pkg/jsk_demos/issues/1286 (`#88 `_) +* add github/workflows (`#101 `_) + + * pddlresulttest: fix for python3, use map and https://stackoverflow.com/questions/60532658/python-2-vs-python-3-difference-in-map-behavior-with-three-arguments + * pddl.py : fix for python3, bytes vs str + * add launch_prefix and repet 5 times + * exit when sovle.l was started from rostest + * increase time-limit + * run assertTrue at end of test + +* update LPG download link (`#97 `_) +* Add obinata demo (`#99 `_) + + * Use only move-with-obj action by introducing none item + * Use different initial condition for office demo and kitchen car demo + * Add obinata's multiple robot cooperation demo + * add launch to run simple_metric_plan + +* add CHECK_PYTHON2_COMPILE, CHECK_PYTHON3_COMPILE (`#96 `_) + + * 2to3 -w -f has_key * + * 2to3 -w -f print * + +* cannot run graph-solver for pddl-graph (`#94 `_) + + * add test to check `#92 `_ + * :add-neighbor is obsolated methods, use :add-arc-from-to https://github.com/euslisp/jskeus/blob/689b015f0c727616e2745652423f2918d1e52252/irteus/irtgraph.l#L379 + +* add test to check pddl planning results (`#89 `_) + + * search_object/simple_failure_torelant : run euslisp planning script with repeat.sh + * use unique test-name + * use proc.returncode instead of proc.poll() + * test multiple sequence_action at once + * pddlresulttest: support multiple sequence at once + * add add_rostest(test/search_object.test) + * demos/search_object: use display_graph to gnome-open pdf + * [pddl_planner/demos/search_object] fix bug, and add launch file + * add_rostest for test directory + * add pddl result test for demo + * add simple_metric/simple_metric.launch + * 2016_kamada_durative: demo.launch,example.launch starts euslisp file too, for complete example + * gnome-open .pdf only when ~display_graph is set + * use display_graph argument for launch file to skip gnome-open pdf + demos/2008_okada_ias/demo_pour_tea.launch + demos/2011_kakiuchi/demo_cleanup_table.launch + demos/2011_saito/demo-knock-door.launch + demos/2011_saito/demo-simple-task.launch + demos/2011_saito/demo-taking-elevator.launch + demos/simple_failure_torelant/demo_simple_failure_torelant.launch + demos/2013_fridge_demo/demo_bring_can.launch + demos/hanoi/demo_hanoi.launch + * add pddlresulttest + * use shell to run pddl solver + * add test to reproduce https://github.com/jsk-ros-pkg/jsk_demos/issues/1286 + +* [pddl_planner/demos/simple_metrix] add launch file (`#77 `_) +* use xdg-open instad of evince. Both installed by ubuntu-desktop package (`#76 `_) +* [pddl_planner] format README.md (`#74 `_) + +* Contributors: Kei Okada, Koki Shinjo, Naoki Hiraoka, Naoya Yamaguchi, Yoshiki Obinata + 0.1.12 (2020-04-01) ------------------- * Add max_planning_time option (`#70 `_) diff --git a/pddl/pddl_planner/CMakeLists.txt b/pddl/pddl_planner/CMakeLists.txt index 1f16513..f0249f1 100644 --- a/pddl/pddl_planner/CMakeLists.txt +++ b/pddl/pddl_planner/CMakeLists.txt @@ -14,4 +14,14 @@ if(CATKIN_ENABLE_TESTING) add_rostest(test/test-simple-failure-torelant.test) add_rostest(test/test-sample-pddl.test) add_rostest(test/test-durative-two-robot-tablecloth.test) + add_rostest(test/2008_okada_ias.test) + add_rostest(test/2011_kakiuchi.test) + add_rostest(test/2011_saito_knock_door.test) + add_rostest(test/2011_saito_simple.test) + add_rostest(test/2013_fridge_demo.test) + ## add_rostest(test/2016_kamada_durative.test) ## this requries lpg_planner, which is needs source install + add_rostest(test/demos_hanoi.test) + add_rostest(test/search_object.test) + add_rostest(test/simple_failure_torelant.test) + add_rostest(test/simple_metric.test) endif() diff --git a/pddl/pddl_planner/README.md b/pddl/pddl_planner/README.md index b7b4352..bd79b71 100644 --- a/pddl/pddl_planner/README.md +++ b/pddl/pddl_planner/README.md @@ -1,4 +1,4 @@ -## pddl_planner +# pddl_planner This package provides ROS interface for ff/ffha/downward planners @@ -6,47 +6,53 @@ This package provides ROS interface for ff/ffha/downward planners - ffha: [Emil Keyder, Hector Geffner, "The FF(ha) Planner for Planning with Action Costs"](http://ipc.informatik.uni-freiburg.de/Planners?action=AttachFile&do=view&target=ffha.pdf) - downward: http://www.fast-downward.org/ -### demos/sample-pddl +## demos/sample-pddl -- bare example +### bare example - - ff example - ``` +- ff example + +``` roscd pddl_planner/demos/sample-pddl/ rosrun ff ff -f ./sample-problem.pddl -o sample-domain.pddl - ``` +``` + +- ffha example - - ffha example - ``` +``` roscd pddl_planner/demos/sample-pddl/ rosrun ffha ffha -f ./sample-problem.pddl -o sample-domain.pddl - ``` +``` - - downward example - ``` +- downward example + +``` roscd pddl_planner/demos/sample-pddl/ rosrun downward plan sample-domain.pddl ./sample-problem.pddl ipc seq-sat-lama-2011 --plan-file sample.plan - ``` +``` + +### ros example -- ros example +This package provides ROS actionlib interface for planners, using API defined in [pddl_msgs](https://github.com/jsk-ros-pkg/jsk_planning/blob/master/pddl/pddl_msgs/action/PDDLPlanner.action). +Please see [pddl_planner/demos/sample-pddl/sample-client.py](https://github.com/jsk-ros-pkg/jsk_planning/blob/master/pddl/pddl_planner/demos/sample-pddl/sample-client.py) for cliet example. - This package provides ROS actionlib interface for planners, using API defined in [pddl_msgs](https://github.com/jsk-ros-pkg/jsk_planning/blob/master/pddl/pddl_msgs/action/PDDLPlanner.action), see [pddl_planner/demos/sample-pddl/sample-client.py](https://github.com/jsk-ros-pkg/jsk_planning/blob/master/pddl/pddl_planner/demos/sample-pddl/sample-client.py) for cliet example. +- ff example - - ff example - ``` +``` roslaunch pddl_planner pddl_ff.launch rosrun pddl_planner sample-client.py --text - ``` +``` - - ffha example - ``` +- ffha example + +``` roslaunch pddl_planner pddl_ffha.launch rosrun pddl_planner sample-client.py --text - ``` +``` + +- downward example - - downward example - ``` +``` roslaunch pddl_planner pddl_downward.launch rosrun pddl_planner sample-client.py --text - ``` - +``` diff --git a/pddl/pddl_planner/demos/2008_okada_ias/demo_pour_tea.launch b/pddl/pddl_planner/demos/2008_okada_ias/demo_pour_tea.launch index bb7c515..bb87531 100644 --- a/pddl/pddl_planner/demos/2008_okada_ias/demo_pour_tea.launch +++ b/pddl/pddl_planner/demos/2008_okada_ias/demo_pour_tea.launch @@ -1,7 +1,10 @@ + + - + diff --git a/pddl/pddl_planner/demos/2008_okada_ias/solve-pour-tea.l b/pddl/pddl_planner/demos/2008_okada_ias/solve-pour-tea.l index f29e4b1..c79b961 100755 --- a/pddl/pddl_planner/demos/2008_okada_ias/solve-pour-tea.l +++ b/pddl/pddl_planner/demos/2008_okada_ias/solve-pour-tea.l @@ -1,5 +1,7 @@ #!/usr/bin/env roseus +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (load "package://pddl_planner/src/pddl-result-graph.l") (load "package://pddl_planner/src/eus-pddl-client.l") @@ -122,7 +124,6 @@ (send gr :write-to-pdf "okada_ias.pdf") (when (ros::get-param "~display_graph" "true") - (piped-fork "gnome-open okada_ias.pdf")) + (piped-fork "xdg-open okada_ias.pdf")) -(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) - (ros::exit)) +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/2011_kakiuchi/demo_cleanup_table.launch b/pddl/pddl_planner/demos/2011_kakiuchi/demo_cleanup_table.launch index da13059..6b49647 100644 --- a/pddl/pddl_planner/demos/2011_kakiuchi/demo_cleanup_table.launch +++ b/pddl/pddl_planner/demos/2011_kakiuchi/demo_cleanup_table.launch @@ -1,7 +1,8 @@ + - + diff --git a/pddl/pddl_planner/demos/2011_kakiuchi/solve-cleanup-table.l b/pddl/pddl_planner/demos/2011_kakiuchi/solve-cleanup-table.l index ecba225..f69c659 100755 --- a/pddl/pddl_planner/demos/2011_kakiuchi/solve-cleanup-table.l +++ b/pddl/pddl_planner/demos/2011_kakiuchi/solve-cleanup-table.l @@ -174,7 +174,7 @@ (send *graph* :write-to-pdf "kakiuchi_robomec.pdf") (when (ros::get-param "~display_graph") - (piped-fork "gnome-open kakiuchi_robomec.pdf")) + (piped-fork "xdg-open kakiuchi_robomec.pdf")) (when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) (ros::exit)) diff --git a/pddl/pddl_planner/demos/2011_saito/demo-knock-door.launch b/pddl/pddl_planner/demos/2011_saito/demo-knock-door.launch index f24d4dc..271992e 100644 --- a/pddl/pddl_planner/demos/2011_saito/demo-knock-door.launch +++ b/pddl/pddl_planner/demos/2011_saito/demo-knock-door.launch @@ -1,8 +1,11 @@ + + - + diff --git a/pddl/pddl_planner/demos/2011_saito/demo-simple-task.launch b/pddl/pddl_planner/demos/2011_saito/demo-simple-task.launch index 4fdb2e4..f93bbc2 100644 --- a/pddl/pddl_planner/demos/2011_saito/demo-simple-task.launch +++ b/pddl/pddl_planner/demos/2011_saito/demo-simple-task.launch @@ -1,8 +1,9 @@ + - + diff --git a/pddl/pddl_planner/demos/2011_saito/demo-taking-elevator.launch b/pddl/pddl_planner/demos/2011_saito/demo-taking-elevator.launch index 5ec9849..bbd1422 100644 --- a/pddl/pddl_planner/demos/2011_saito/demo-taking-elevator.launch +++ b/pddl/pddl_planner/demos/2011_saito/demo-taking-elevator.launch @@ -1,7 +1,8 @@ + - + diff --git a/pddl/pddl_planner/demos/2011_saito/solve-knock-door.l b/pddl/pddl_planner/demos/2011_saito/solve-knock-door.l index c7b171e..da7b874 100755 --- a/pddl/pddl_planner/demos/2011_saito/solve-knock-door.l +++ b/pddl/pddl_planner/demos/2011_saito/solve-knock-door.l @@ -1,5 +1,7 @@ #!/usr/bin/env roseus +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (load "package://pddl_planner/src/pddl-result-graph.l") (load "package://pddl_planner/src/eus-pddl-client.l") @@ -184,9 +186,9 @@ (send *graph* :name (send *domain* :name)) -;(send *graph* :write-to-pdf "knock_demo.pdf") -;(when (ros::get-param "~display_graph") -; (piped-fork "gnome-open knock_demo.pdf")) +(send *graph* :write-to-pdf "knock_demo.pdf") +(when (ros::get-param "~display_graph") + (piped-fork "xdg-open knock_demo.pdf")) ;; action definition ;; domain -> package @@ -218,5 +220,4 @@ ;; global data is not used (nil) (exec-smach-with-spin (convert-smach *graph*) nil :hz 1.0) -(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) - (ros::exit)) +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/2011_saito/solve-simple-task.l b/pddl/pddl_planner/demos/2011_saito/solve-simple-task.l index 8d0075c..eb02f6d 100755 --- a/pddl/pddl_planner/demos/2011_saito/solve-simple-task.l +++ b/pddl/pddl_planner/demos/2011_saito/solve-simple-task.l @@ -133,7 +133,7 @@ (send *graph* :write-to-pdf "knock_demo.pdf") (when (ros::get-param "~display_graph") - (piped-fork "gnome-open knock_demo.pdf")) + (piped-fork "xdg-open knock_demo.pdf")) ;; action definition ;; domain -> package diff --git a/pddl/pddl_planner/demos/2011_saito/solve-taking-elevator.l b/pddl/pddl_planner/demos/2011_saito/solve-taking-elevator.l index b29162c..9d93cda 100755 --- a/pddl/pddl_planner/demos/2011_saito/solve-taking-elevator.l +++ b/pddl/pddl_planner/demos/2011_saito/solve-taking-elevator.l @@ -148,7 +148,7 @@ (send *graph* :write-to-pdf "knock_demo.pdf") (when (ros::get-param "~display_graph") - (piped-fork "gnome-open knock_demo.pdf") + (piped-fork "xdg-open knock_demo.pdf") (when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) (ros::exit)) diff --git a/pddl/pddl_planner/demos/2013_fridge_demo/demo_bring_can.launch b/pddl/pddl_planner/demos/2013_fridge_demo/demo_bring_can.launch index a2c4e03..728e4b3 100644 --- a/pddl/pddl_planner/demos/2013_fridge_demo/demo_bring_can.launch +++ b/pddl/pddl_planner/demos/2013_fridge_demo/demo_bring_can.launch @@ -1,8 +1,11 @@ + + - + diff --git a/pddl/pddl_planner/demos/2013_fridge_demo/solve-bring-can.l b/pddl/pddl_planner/demos/2013_fridge_demo/solve-bring-can.l index f55c001..1c0584c 100755 --- a/pddl/pddl_planner/demos/2013_fridge_demo/solve-bring-can.l +++ b/pddl/pddl_planner/demos/2013_fridge_demo/solve-bring-can.l @@ -1,5 +1,7 @@ #!/usr/bin/env roseus +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (require :eus-pddl-client "package://pddl_planner/src/eus-pddl-client.l") (require :pddl-result-graph "package://pddl_planner/src/pddl-result-graph.l") @@ -151,7 +153,8 @@ (when (and (ros::has-param "~display_graph") (ros::get-param "~display_graph")) - ;;(piped-fork "gnome-open debug.pdf") + + (piped-fork "xdg-open debug.pdf") (load "package://roseus_smach/src/pddl2smach.l") (load "package://roseus_smach/src/state-machine-ros.l") @@ -161,5 +164,4 @@ (send *sm-inspect* :reset-state) ) -(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) - (ros::exit)) +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/2016_kamada_durative/demo.launch b/pddl/pddl_planner/demos/2016_kamada_durative/demo.launch index 9ae2b95..eb109e0 100644 --- a/pddl/pddl_planner/demos/2016_kamada_durative/demo.launch +++ b/pddl/pddl_planner/demos/2016_kamada_durative/demo.launch @@ -1,4 +1,5 @@ + + + + diff --git a/pddl/pddl_planner/demos/2016_kamada_durative/example.launch b/pddl/pddl_planner/demos/2016_kamada_durative/example.launch index 5ff24fa..ed8e429 100644 --- a/pddl/pddl_planner/demos/2016_kamada_durative/example.launch +++ b/pddl/pddl_planner/demos/2016_kamada_durative/example.launch @@ -1,4 +1,6 @@ + + + + + diff --git a/pddl/pddl_planner/demos/2016_kamada_durative/tools.l b/pddl/pddl_planner/demos/2016_kamada_durative/tools.l index 2187c81..29a2343 100644 --- a/pddl/pddl_planner/demos/2016_kamada_durative/tools.l +++ b/pddl/pddl_planner/demos/2016_kamada_durative/tools.l @@ -160,10 +160,11 @@ (unix:system (format nil "dot ~A -Tpdf -o ~A" ".verbose.dot" ".verbose.pdf")) (unix:system (format nil "dot ~A -Tpdf -o ~A" ".verbose_separated.dot" ".verbose_separated.pdf")) (unix:system (format nil "dot ~A -Tpdf -o ~A" ".inter_robot_relationship.dot" ".inter_robot_relationship.pdf")) - (piped-fork "gnome-open .normal.pdf") - (piped-fork "gnome-open .normal_separated.pdf") - (piped-fork "gnome-open .verbose.pdf") - (piped-fork "gnome-open .verbose_separated.pdf") - (piped-fork "gnome-open .inter_robot_relationship.pdf") + (when (ros::get-param "~display_graph") + (piped-fork "xdg-open .normal.pdf") + (piped-fork "xdg-open .normal_separated.pdf") + (piped-fork "xdg-open .verbose.pdf") + (piped-fork "xdg-open .verbose_separated.pdf") + (piped-fork "xdg-open .inter_robot_relationship.pdf") )) ) diff --git a/pddl/pddl_planner/demos/2020_obinata_cooperation/demo_cooperation_task.launch b/pddl/pddl_planner/demos/2020_obinata_cooperation/demo_cooperation_task.launch new file mode 100644 index 0000000..894b869 --- /dev/null +++ b/pddl/pddl_planner/demos/2020_obinata_cooperation/demo_cooperation_task.launch @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/pddl/pddl_planner/demos/2020_obinata_cooperation/solve-cooperation-task.l b/pddl/pddl_planner/demos/2020_obinata_cooperation/solve-cooperation-task.l new file mode 100755 index 0000000..d277b15 --- /dev/null +++ b/pddl/pddl_planner/demos/2020_obinata_cooperation/solve-cooperation-task.l @@ -0,0 +1,193 @@ +#!/usr/bin/env roseus + +#| +使い方 +$ roslaunch pddl_planner demo_cooperation_task.launch demo:=office +$ roslaunch pddl_planner demo_cooperation_task.launch demo:=kitchen_car + +初期条件: +・fetchは73B2、spotは2号館入り口にいる +・書類は73B2、弁当はキッチンカーにある +・ロボットが移動できる場所は以下の組み合わせのみで、fetch、spotで異なる移動コストが与えられている。 + - 73B2 <-> エレベータ + - 73B2 <-> 階段 + - エレベータ <-> 事務室 + - エレベータ <-> 2号館入り口 + - 階段 <-> 事務室 + - 階段 <-> 2号館入り口 + - 2号館入り口 <-> キッチンカー + +終了条件(以下のどちらかをrosparamで選択可能): +・書類が事務室にあり、かつ、fetchが73B2に戻ってくる +・弁当が73B2にある + +その他の条件: +・コストを最小化した経路を計算 +・spotはfetchが2号館入り口に居るときのみ移動可能 +・ロボット(fetch or spot)は、物品(書類 or 弁当)と同じ場所に居るときのみ、その物品と一緒に移動できる。 +|# + +(ros::roseus "solve_cooperation_task") + +(load "package://pddl_planner/src/pddl-result-graph.l") +(load "package://pddl_planner/src/eus-pddl-client.l") + +;; domain +(setq *domain* (instance pddl-domain :init :name 'cooperation)) +(send *domain* :requirements '(:typing :action-costs)) +(send *domain* :types '(robot item place)) +;; predicates: 述語 +(send *domain* :predicates '((robot-in-place ?robot - robot ?place - place) ;; ?robotが?placeに存在する + (item-in-place ?item - item ?place - place) ;; ?itemが?placeに存在する + (can-move ?from ?to - place))) ;; ロボットが?toから?fromに移動できるか +;; 使用する関数の宣言 +(send *domain* :functions '((total-cost) ;; 合計の移動コスト + (move-cost ?robot - robot ?from - place ?to - place))) ;; 各移動にかかるコスト + +;; making action +(setq *actions* + (list + (setq *fetch-move-with-obj* (instance pddl-action :init + :name "fetch-move-with-obj" + :parameters '((?item item) (?from ?to place)) + :precondition '((robot-in-place fetch ?from) + (item-in-place ?item ?from) + (can-move ?from ?to)) + :effect '((robot-in-place fetch ?to) + (item-in-place ?item ?to) + (not (robot-in-place fetch ?from)) + (not (item-in-place ?item ?from)) + (increase (total-cost) (move-cost fetch ?from ?to)) + ))) + (setq *spot-move-with-obj* (instance pddl-action :init + :name "spot-move-with-obj" + :parameters '((?item item) (?from ?to place)) + :precondition '((robot-in-place spot ?from) + (robot-in-place fetch eng2-entrance) + (item-in-place ?item ?from) + (can-move ?from ?to)) + :effect '((robot-in-place spot ?to) + (item-in-place ?item ?to) + (not (robot-in-place spot ?from)) + (not (item-in-place ?item ?from)) + (increase (total-cost) (move-cost spot ?from ?to)) + ))) + )) + +;;add actions to domain +(dolist (action *actions*) + (send *domain* :add :action action)) + +;; problem +(setq *problem* (instance pddl-problem :init :name 'otsukai :domain 'cooperation)) + +;; 使用する変数の宣言。 +(send *problem* :objects + '( + ;; item + (none . item) + (document . item) + (lunch-box . item) + ;; robot + (fetch . robot) + (spot . robot) + ;; places + (room-73b2 . place) + (stairs . place) + (elevator . place) + (eng2-entrance . place) + (office . place) + (kitchen-car . place))) + +;; 初期条件 +(setq *initial-condition* + '(;; 物品・ロボットの初期位置 + (item-in-place none room-73b2) + (item-in-place none elevator) + (item-in-place none stairs) + (item-in-place none office) + (item-in-place none eng2-entrance) + (item-in-place none kitchen-car) + (robot-in-place fetch room-73b2) + (robot-in-place spot eng2-entrance) + ;; 移動可能な場所 + (can-move room-73b2 elevator) + (can-move room-73b2 stairs) + (can-move elevator office) + (can-move elevator eng2-entrance) + (can-move stairs office) + (can-move stairs eng2-entrance) + (can-move eng2-entrance kitchen-car) + (can-move elevator room-73b2) ;; ここからfromとtoを逆にしている + (can-move stairs room-73b2) + (can-move office elevator) + (can-move eng2-entrance elevator) + (can-move office stairs) + (can-move eng2-entrance stairs) + (can-move kitchen-car eng2-entrance) + ;; トータル移動コスト + (= (total-cost) 0) + ;; fetch移動コスト + (= (move-cost fetch room-73b2 elevator) 3) + (= (move-cost fetch room-73b2 stairs) 99999) + (= (move-cost fetch elevator office) 10) + (= (move-cost fetch elevator eng2-entrance) 5) + (= (move-cost fetch stairs office) 99999) + (= (move-cost fetch stairs eng2-entrance) 1) + (= (move-cost fetch eng2-entrance kitchen-car) 100) + (= (move-cost fetch elevator room-73b2) 3) ;; ここからfromとtoを逆にしている + (= (move-cost fetch stairs room-73b2) 99999) + (= (move-cost fetch office elevator) 10) + (= (move-cost fetch eng2-entrance elevator) 5) + (= (move-cost fetch office stairs) 99999) + (= (move-cost fetch eng2-entrance stairs) 99999) + (= (move-cost fetch kitchen-car eng2-entrance) 100) + ;; spot移動コスト + (= (move-cost spot room-73b2 elevator) 30) + (= (move-cost spot room-73b2 stairs) 50) + (= (move-cost spot elevator office) 100) + (= (move-cost spot elevator eng2-entrance) 100) + (= (move-cost spot stairs office) 50) + (= (move-cost spot stairs eng2-entrance) 50) + (= (move-cost spot eng2-entrance kitchen-car) 3) + (= (move-cost spot elevator room-73b2) 30) ;; ここからfromとtoを逆にしている + (= (move-cost spot stairs room-73b2) 50) + (= (move-cost spot office elevator) 100) + (= (move-cost spot eng2-entrance elevator) 100) + (= (move-cost spot office stairs) 50) + (= (move-cost spot eng2-entrance stairs) 50) + (= (move-cost spot kitchen-car eng2-entrance) 3) + )) + +(cond + ;; 事務室デモ + ;; 初期条件の追加:最初、書類が73B2にある。 + ;; 終了条件:最後、書類が事務室にあり、かつ、fetchが73B2に戻ってくる + ((equal (ros::get-param "~demo") "office") + (setq *initial-condition* (cons '(item-in-place document room-73b2) *initial-condition*)) + (setq *goal-condition* + '((robot-in-place fetch room-73b2) + (item-in-place document office)))) + ;; キッチンカーデモ + ;; 初期条件の追加:最初、お弁当がキッチンカーがある。 + ;; 終了条件:最後、弁当箱が73B2にある。 + ((equal (ros::get-param "~demo") "kitchen_car") + (setq *initial-condition* (cons '(item-in-place lunch-box kitchen-car) *initial-condition*)) + (setq *goal-condition* + '((item-in-place lunch-box room-73b2)))) + (t + (ros::ros-error "Invalid rosparam for ~demo") + (exit))) + +(send *problem* :initial-condition *initial-condition*) +(send *problem* :goal-condition *goal-condition*) + +;; solve planning +(send *problem* :metric '(minimize (total-cost))) +(pprint (setq *result* (solve-pddl-planning *domain* *problem*))) +(setq gr (make-graph-from-pddl-results (list *result*) :node-name :pprint)) +(send gr :write-to-pdf "cooperation.pdf") +(when (ros::get-param "~display_graph" "true") + (piped-fork "xdg-open cooperation.pdf")) +(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) + (ros::exit)) diff --git a/pddl/pddl_planner/demos/hanoi/demo_hanoi.launch b/pddl/pddl_planner/demos/hanoi/demo_hanoi.launch index add26b4..4696289 100644 --- a/pddl/pddl_planner/demos/hanoi/demo_hanoi.launch +++ b/pddl/pddl_planner/demos/hanoi/demo_hanoi.launch @@ -1,7 +1,10 @@ + + - + diff --git a/pddl/pddl_planner/demos/hanoi/solve-hanoi.l b/pddl/pddl_planner/demos/hanoi/solve-hanoi.l index fc481cd..a424962 100755 --- a/pddl/pddl_planner/demos/hanoi/solve-hanoi.l +++ b/pddl/pddl_planner/demos/hanoi/solve-hanoi.l @@ -1,6 +1,8 @@ #!/usr/bin/env roseus ;; mostly same to demo-eus.l in pddl package under jsk subversion trunk +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (load "package://pddl_planner/src/pddl-result-graph.l") (load "package://pddl_planner/src/eus-pddl-client.l") @@ -81,7 +83,6 @@ (send gr :write-to-pdf "hanoi.pdf") (when (ros::get-param "~display_graph" "true") - (piped-fork "gnome-open hanoi.pdf")) + (piped-fork "xdg-open hanoi.pdf")) -(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) - (ros::exit)) +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/hanoi/solve-hanoi.py b/pddl/pddl_planner/demos/hanoi/solve-hanoi.py index d10c806..e899aae 100755 --- a/pddl/pddl_planner/demos/hanoi/solve-hanoi.py +++ b/pddl/pddl_planner/demos/hanoi/solve-hanoi.py @@ -79,7 +79,7 @@ "(clear c)", "(handempty)"] goal.problem.goal = "(and (on a b) (on b c))" - print goal + print(goal) client.send_goal(goal) client.wait_for_result() - print client.get_result() + print(client.get_result()) diff --git a/pddl/pddl_planner/demos/search_object/demo_search_object.launch b/pddl/pddl_planner/demos/search_object/demo_search_object.launch new file mode 100644 index 0000000..4e138bb --- /dev/null +++ b/pddl/pddl_planner/demos/search_object/demo_search_object.launch @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/pddl/pddl_planner/demos/search_object/solve-search-object.l b/pddl/pddl_planner/demos/search_object/solve-search-object.l index 3ca4d71..116ca63 100755 --- a/pddl/pddl_planner/demos/search_object/solve-search-object.l +++ b/pddl/pddl_planner/demos/search_object/solve-search-object.l @@ -1,4 +1,7 @@ #!/usr/bin/env roseus + +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (require :eus-pddl-client "package://pddl_planner/src/eus-pddl-client.l") (require :pddl-result-graph "package://pddl_planner/src/pddl-result-graph.l") @@ -125,22 +128,20 @@ ;; ;; normal plan -(pprint (setq *result* (solve-pddl-planning *domain* *problem* :debug nil))) +(setq *graph* (pddl-plan-to-graph nil :domain *domain* :problem *problem* :failed-nodes (list 'detect :debug nil))) ;; there is no target object in environment (pprint (setq *result-fail-end* (solve-pddl-planning *domain* *problem-fail-end* :debug nil))) -;; at first, make graph from failed plan (because failed plan does not contain success detection) -(setq *graph* (make-graph-from-pddl-results (list *result-fail-end*) :node-name :pprint)) ;; merge 2 results and adding failure -(setq *graph* (add-failed-nodes *result* (list 'detect) :graph *graph*)) +(setq *graph* (make-graph-from-pddl-results (list *result-fail-end*) :node-name :pprint :graph *graph*)) (make-readable-graph *graph* :copy nil) -;;(send *graph* :write-to-pdf "debug.pdf") +(send *graph* :write-to-pdf "debug.pdf") (when (and (ros::has-param "~display_graph") (ros::get-param "~display_graph")) - ;;(piped-fork "gnome-open debug.pdf") + (piped-fork "xdg-open debug.pdf") (load "package://roseus_smach/src/pddl2smach.l") (load "package://roseus_smach/src/state-machine-ros.l") @@ -150,5 +151,4 @@ (send sm-inspect :reset-state) ) -(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) - (ros::exit)) +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/simple_failure_torelant/demo_simple_failure_torelant.launch b/pddl/pddl_planner/demos/simple_failure_torelant/demo_simple_failure_torelant.launch index 3f1de12..7a438f2 100644 --- a/pddl/pddl_planner/demos/simple_failure_torelant/demo_simple_failure_torelant.launch +++ b/pddl/pddl_planner/demos/simple_failure_torelant/demo_simple_failure_torelant.launch @@ -1,9 +1,13 @@ + + + diff --git a/pddl/pddl_planner/demos/simple_failure_torelant/solve-simple-failure-torelant.l b/pddl/pddl_planner/demos/simple_failure_torelant/solve-simple-failure-torelant.l index 83cff96..ae10c75 100755 --- a/pddl/pddl_planner/demos/simple_failure_torelant/solve-simple-failure-torelant.l +++ b/pddl/pddl_planner/demos/simple_failure_torelant/solve-simple-failure-torelant.l @@ -71,8 +71,11 @@ (require :pddl-result-graph "package://pddl_planner/src/pddl-result-graph.l") (setq *graph* (pddl-plan-to-graph nil :domain *domain* :problem *problem* :failed-nodes *failed-nodes* :debug t)) - (send *graph* :write-to-pdf "/tmp/graph.pdf" nil "simple_failure_torelant") - (piped-fork "gnome-open /tmp/graph.pdf") + (when (and (ros::has-param "~display_graph") + (ros::get-param "~display_graph")) + (send *graph* :write-to-pdf "/tmp/graph.pdf" nil "simple_failure_torelant") + (piped-fork "xdg-open /tmp/graph.pdf") + ) (require :pddl2smach "package://roseus_smach/src/pddl2smach.l") (require :state-machine-ros "package://roseus_smach/src/state-machine-ros.l") diff --git a/pddl/pddl_planner/demos/simple_metric/demo_simple_metric.launch b/pddl/pddl_planner/demos/simple_metric/demo_simple_metric.launch new file mode 100644 index 0000000..6067612 --- /dev/null +++ b/pddl/pddl_planner/demos/simple_metric/demo_simple_metric.launch @@ -0,0 +1,6 @@ + + + + + diff --git a/pddl/pddl_planner/demos/simple_metric/demo_simple_metric_plan.launch b/pddl/pddl_planner/demos/simple_metric/demo_simple_metric_plan.launch new file mode 100644 index 0000000..f40e968 --- /dev/null +++ b/pddl/pddl_planner/demos/simple_metric/demo_simple_metric_plan.launch @@ -0,0 +1,6 @@ + + + + diff --git a/pddl/pddl_planner/demos/simple_metric/simple_metric.launch b/pddl/pddl_planner/demos/simple_metric/simple_metric.launch new file mode 100644 index 0000000..b471cba --- /dev/null +++ b/pddl/pddl_planner/demos/simple_metric/simple_metric.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/pddl/pddl_planner/demos/simple_metric/simple_metric_plan.l b/pddl/pddl_planner/demos/simple_metric/simple_metric_plan.l old mode 100644 new mode 100755 index a87801e..c577416 --- a/pddl/pddl_planner/demos/simple_metric/simple_metric_plan.l +++ b/pddl/pddl_planner/demos/simple_metric/simple_metric_plan.l @@ -1,3 +1,7 @@ +#!/usr/bin/env roseus + +(setq *exit-on-end* (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7))) + (ros::roseus "simple_metric_plan") (load "package://pddl_planner/src/eus-pddl-client.l") @@ -69,4 +73,7 @@ (setq *result* (solve-pddl-planning *domain* *problem* :debug t)) (load "package://pddl_planner/src/pddl-result-graph.l") (setq *graph* (make-graph-from-pddl-results (list *result*) :node-name :pprint)) -(send (make-readable-graph *graph*) :write-to-pdf "test.pdf") +(send (make-readable-graph *graph*) :write-to-pdf "simple_metric_plan.pdf") +(piped-fork "evince simple_metric_plan.pdf") + +(if *exit-on-end* (ros::exit)) diff --git a/pddl/pddl_planner/demos/temporal/README b/pddl/pddl_planner/demos/temporal/README index 2e284fc..49657c7 100644 --- a/pddl/pddl_planner/demos/temporal/README +++ b/pddl/pddl_planner/demos/temporal/README @@ -1,9 +1,8 @@ -# download LPG planner from http://zeus.ing.unibs.it/lpg/ -# -# it work both on lpg-1.2 or lpg-2.0 +# download LPG planner (http://lpg.unibs.it/lpg/lpgtd-1_4-linux.tar.gz) from https://lpg.unibs.it/lpg/register-lpg-td.php +# + +./LPG-td-1.4/lpg-td -o block-domain.pddl -f block-problem.pddl -n 1 +./LPG-td-1.4/lpg-td -o coe-domain.pddl -f coe-problem.pddl -n 1 -./LPG-1.2-linux/lpg-1.2 -o block-domain.pddl -f block-problem.pddl -n 1 -./LPG-1.2-linux/lpg-1.2 -o coe-domain.pddl -f coe-problem.pddl -n 1 - diff --git a/pddl/pddl_planner/package.xml b/pddl/pddl_planner/package.xml index 64fa885..4ed0331 100644 --- a/pddl/pddl_planner/package.xml +++ b/pddl/pddl_planner/package.xml @@ -1,6 +1,6 @@ pddl_planner - 0.1.12 + 0.1.13 pddl planner wrappers Ryohei Ueda diff --git a/pddl/pddl_planner/samples/agentsystem.py b/pddl/pddl_planner/samples/agentsystem.py index c5b604a..6429f9a 100755 --- a/pddl/pddl_planner/samples/agentsystem.py +++ b/pddl/pddl_planner/samples/agentsystem.py @@ -75,7 +75,7 @@ "(clear c)", "(handempty)"] goal.problem.goal = "(and (on a b) (on b c))" - print goal + print(goal) client.send_goal(goal) client.wait_for_result() - print client.get_result() + print(client.get_result()) diff --git a/pddl/pddl_planner/src/eus-pddl.l b/pddl/pddl_planner/src/eus-pddl.l index f85101d..1a9d079 100644 --- a/pddl/pddl_planner/src/eus-pddl.l +++ b/pddl/pddl_planner/src/eus-pddl.l @@ -678,8 +678,11 @@ (ret (mapcar #'(lambda(obj) (if (equal (caddr v) (cdr obj)) (multiple-value-bind (va ar) param - (send self :check-state st (caddr ss) (list (append va (list (car v))) (append ar (list (car obj)))))) - nil) + (send self :check-state + st + (if (= (length v) 3) (caddr ss) (list (car ss) (if (eq '- (cadr v)) (cdddr v) (cdr v)) (caddr ss))) + (list (append va (list (car v))) (append ar (list (car obj)))))) + nil) ) objects))) (null (every #'null ret)))) @@ -688,8 +691,11 @@ (ret (mapcar #'(lambda(obj) (if (equal (caddr v) (cdr obj)) (multiple-value-bind (va ar) param - (send self :check-state st (caddr ss) (list (append va (list (car v))) (append ar (list (car obj)))))) - t) + (send self :check-state + st + (if (= (length v) 3) (caddr ss) (list (car ss) (if (eq '- (cadr v)) (cdddr v) (cdr v)) (caddr ss))) + (list (append va (list (car v))) (append ar (list (car obj)))))) + t) ) objects))) (null (some #'null ret)))) @@ -782,9 +788,12 @@ ('forall (let ((v (cadr ee))) (dolist (obj objects) - (when (equal (caddr v) (cdr obj)) + (when (equal (cadr (memq '- v)) (cdr obj)) (multiple-value-bind (va ar) param - (setq tmp-st (send self :change-state tmp-st (caddr ee) (list (append va (list (car v))) (append ar (list (car obj))))))))) + (setq tmp-st (send self :change-state + tmp-st + (if (= (length v) 3) (caddr ee) (list (car ee) (if (eq '- (cadr v)) (cdddr v) (cdr v)) (caddr ee))) + (list (append va (list (car v))) (append ar (list (car obj))))))))) tmp-st)) ('when (case (caadr ee) diff --git a/pddl/pddl_planner/src/pddl-result-graph.l b/pddl/pddl_planner/src/pddl-result-graph.l index e3f8fbe..72f3be0 100644 --- a/pddl/pddl_planner/src/pddl-result-graph.l +++ b/pddl/pddl_planner/src/pddl-result-graph.l @@ -47,7 +47,9 @@ (string-equal (car x) name))) (send from :neighbor-action-alist)) (warn ";; same arc found ~A~%" name) - (send from :add-neighbor to name))) + (let ((a (send-super :add-arc-from-to from to))) + (send a :name name) + (send from :neighbors)))) (:write-to-dot ;; redefine for adding arc name (fname &optional result-path (title "output")) (let ((node-alist ; ((node . symbol) (node . symbol) ...) diff --git a/pddl/pddl_planner/src/pddl.py b/pddl/pddl_planner/src/pddl.py index f73b536..77e266a 100755 --- a/pddl/pddl_planner/src/pddl.py +++ b/pddl/pddl_planner/src/pddl.py @@ -28,7 +28,11 @@ def read_out(out, nonblock=True): fl = fcntl.fcntl(fd, fcntl.F_GETFL) fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK) try: - return out.read() + ret = out.read() + if ret == None: + return str() + else: + return ret except: return str() @@ -147,7 +151,7 @@ def exec_process(self, command, max_planning_time): if max_planning_time > 0.0: command = ["timeout", str(max_planning_time)] + command rospy.loginfo("Command: %s" % " ".join(command)) - proc = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE) + proc = sp.Popen(" ".join(command), stdout=sp.PIPE, stderr=sp.PIPE, shell=True) try: output, error = str(), str() r = rospy.Rate(10.0) @@ -159,16 +163,28 @@ def exec_process(self, command, max_planning_time): if proc.poll() is not None: break # non-blocking read to avoid dead-lock - output += read_out(proc.stdout) - error += read_out(proc.stderr) + data_out = read_out(proc.stdout) + data_err = read_out(proc.stderr) + if type(data_out) == bytes: + data_out = data_out.decode('utf-8') + if type(data_err) == bytes: + data_err = data_err.decode('utf-8') + output += data_out + error += data_err r.sleep() # flush output data = proc.communicate() - output += data[0] - error += data[1] - - if proc.poll() not in [0, 124]: + data_out = data[0] + data_err = data[1] + if type(data_out) == bytes: + data_out = data_out.decode('utf-8') + if type(data_err) == bytes: + data_err = data_err.decode('utf-8') + output += data_out + error += data_err + + if proc.returncode not in [0, 124]: # 0: normal exit # 124: exited with timeout command # others: process exited abnormally @@ -264,7 +280,7 @@ def gen_problem_objects_strings(self, objects): for o in objects: object_name = o.name # find same object_type in grouped_objects - if grouped_objects.has_key(o.type): + if o.type in grouped_objects: grouped_objects[o.type].append(o.name) else: grouped_objects[o.type] = [o.name] diff --git a/pddl/pddl_planner/test/2008_okada_ias.test b/pddl/pddl_planner/test/2008_okada_ias.test new file mode 100644 index 0000000..4fa8ad3 --- /dev/null +++ b/pddl/pddl_planner/test/2008_okada_ias.test @@ -0,0 +1,20 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 60 + sequence_action: ['(HOLD CUP LARM BAR)', '(MOVE-TO BAR SINK)', '(OPEN-TAP)', '(WASH-CUP)', '(PLACE CUP LARM SINK)'] + - name: /pddl_planner/result + timeout: 60 + sequence_action: ['(HOLD CUP LARM BAR)', '(HOLD BOTTLE RARM BAR)', '(POUR-TEA)', '(PLACE CUP LARM BAR)', '(PLACE BOTTLE RARM BAR)'] + + + diff --git a/pddl/pddl_planner/test/2011_kakiuchi.test b/pddl/pddl_planner/test/2011_kakiuchi.test new file mode 100644 index 0000000..f3c9547 --- /dev/null +++ b/pddl/pddl_planner/test/2011_kakiuchi.test @@ -0,0 +1,25 @@ + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(SEARCH)', '(MOVE START TABLE)', '(CHECKCLEAR)'] + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(SEARCH)', '(MOVE TRASHBOX TABLE)', '(CHECKCLEAR)'] + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(SEARCH)', '(MOVE TABLE TRASHBOX)', '(DISPOSE)', '(CONFIRM TABLE)', '(MOVE TRASHBOX TABLE)', '(CHECKCLEAR)'] + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(PICK TRASH TABLE)', '(CONFIRM TRASHBOX)', '(MOVE TABLE TRASHBOX)', '(DISPOSE)', '(CONFIRM TABLE)', '(MOVE TRASHBOX TABLE)', '(CHECKCLEAR)'] + + + diff --git a/pddl/pddl_planner/test/2011_saito_knock_door.test b/pddl/pddl_planner/test/2011_saito_knock_door.test new file mode 100644 index 0000000..dbb5baf --- /dev/null +++ b/pddl/pddl_planner/test/2011_saito_knock_door.test @@ -0,0 +1,26 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 30 + sequence_action: ['(WIPE SAITO-TABLE)', '(MOVE RM73A3-CENTER SHOPFRONT)', '(BUY SANDWITCH)', '(MOVE SHOPFRONT RM73A3-CENTER)', '(PUT SANDWITCH SAITO-TABLE)'] + - name: /pddl_planner/result + timeout: 30 + sequence_action: ['(MOVE RM73B2-DOORFRONT SHOPFRONT)', '(BUY SANDWITCH)', '(MOVE SHOPFRONT RM73A3-CENTER)', '(WIPE SAITO-TABLE)', '(PUT SANDWITCH SAITO-TABLE)'] + - name: /pddl_planner/result + timeout: 30 + sequence_action: ['(MOVE RM73A3-CENTER RM73B2-DOORFRONT)', '(OPEN RM73B2-DOOR)', '(CHECK_OPEN RM73B2-DOOR)', '(MOVE RM73B2-DOORFRONT RM73A3-CENTER)', '(MOVE RM73A3-CENTER RM73B2-TABLEFRONT)', '(PICK PLASTIC-BOTTLE)', '(WIPE RM73B2-TABLE)', '(MOVE RM73B2-TABLEFRONT RM73A3-CENTER)'] + - name: /pddl_planner/result + timeout: 30 + sequence_action: ['(MOVE RM73A3-CENTER RM73B2-DOORFRONT)', '(OPEN RM73B2-DOOR)', '(CHECK_OPEN RM73B2-DOOR)', '(MOVE RM73B2-DOORFRONT RM73A3-CENTER)', '(MOVE RM73A3-CENTER RM73B2-TABLEFRONT)', '(PICK PLASTIC-BOTTLE)', '(MOVE RM73B2-TABLEFRONT RM73A3-CENTER)', '(MOVE RM73A3-CENTER TRASHBOXFRONT)', '(PUT PLASTIC-BOTTLE TRASHBOX)', '(MOVE TRASHBOXFRONT RM73A3-CENTER)'] + + + diff --git a/pddl/pddl_planner/test/2011_saito_simple.test b/pddl/pddl_planner/test/2011_saito_simple.test new file mode 100644 index 0000000..e95771c --- /dev/null +++ b/pddl/pddl_planner/test/2011_saito_simple.test @@ -0,0 +1,16 @@ + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(KNOCK DOOR)', '(MOVE ROOM-FRONT ROOM-INSIDE)', '(WIPE DESK)'] + + + diff --git a/pddl/pddl_planner/test/2013_fridge_demo.test b/pddl/pddl_planner/test/2013_fridge_demo.test new file mode 100644 index 0000000..20ac83f --- /dev/null +++ b/pddl/pddl_planner/test/2013_fridge_demo.test @@ -0,0 +1,30 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(MOVE-RECOVERLY)', '(MOVE-TO FRONTFRIDGE START)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(TRY-CLOSE)', '(MOVE-RECOVERLY)', '(MOVE-TO FRONTFRIDGE START)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(TRY-CLOSE)', '(MOVE-RECOVERLY)', '(OPEN-DOOR)', '(MOVE-TO FRONTFRIDGE PREGRASP)', '(GRASP-OBJECT CAN)', '(MOVE-TO PREGRASP START)', '(MOVE-TO START PRECLOSE)', '(CLOSE-DOOR)', '(MOVE-TO PRECLOSE START)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(MOVE-RECOVERLY)', '(OPEN-DOOR)', '(MOVE-TO FRONTFRIDGE PREGRASP)', '(GRASP-OBJECT CAN)', '(MOVE-TO PREGRASP START)', '(MOVE-TO START PRECLOSE)', '(CLOSE-DOOR)', '(MOVE-TO PRECLOSE START)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(MOVE-TO START FRONTFRIDGE)', '(OPEN-DOOR)', '(MOVE-TO FRONTFRIDGE PREGRASP)', '(GRASP-OBJECT CAN)', '(MOVE-TO PREGRASP START)', '(MOVE-TO START SOMEWHERE)', '(TRY-CLOSE)', '(MOVE-RECOVERLY)', '(MOVE-TO FRONTFRIDGE START)'] + + + diff --git a/pddl/pddl_planner/test/2016_kamada_durative.test b/pddl/pddl_planner/test/2016_kamada_durative.test new file mode 100644 index 0000000..52b7533 --- /dev/null +++ b/pddl/pddl_planner/test/2016_kamada_durative.test @@ -0,0 +1,34 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 30 + negative: False + + + + diff --git a/pddl/pddl_planner/test/demos_hanoi.test b/pddl/pddl_planner/test/demos_hanoi.test new file mode 100644 index 0000000..4556a30 --- /dev/null +++ b/pddl/pddl_planner/test/demos_hanoi.test @@ -0,0 +1,17 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 60 + sequence_action: ['(MOVE DISK0 DISK1 POLE2)', '(MOVE DISK1 DISK2 POLE1)', '(MOVE DISK0 POLE2 DISK1)', '(MOVE DISK2 POLE0 POLE2)', '(MOVE DISK0 DISK1 POLE0)', '(MOVE DISK1 POLE1 DISK2)', '(MOVE DISK0 POLE0 DISK1)'] + + + diff --git a/pddl/pddl_planner/test/pddlresulttest b/pddl/pddl_planner/test/pddlresulttest new file mode 100755 index 0000000..952868d --- /dev/null +++ b/pddl/pddl_planner/test/pddlresulttest @@ -0,0 +1,221 @@ +#!/usr/bin/env python +############################################################################### +# Software License Agreement (BSD License) +# +# Copyright (c) 2016, Kentaro Wada. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Willow Garage, Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +############################################################################### + +""" +Integration test node that subscribes to +topic (/pddl_ner/result) and verifies it's contents + +below parameters must be set: + + + + topics: + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(HOLD CUP LARM BAR)', '(MOVE-TO BAR SINK)', '(OPEN-TAP)', '(WASH-CUP)', '(PLACE CUP LARM SINK)'] + + + +Author: Kentaro Wada +Modified for PddlResultTest by +""" +from __future__ import print_function + +import sys +import time +import unittest + +import rospy +import rostopic + +from pddl_msgs.msg import PDDLPlannerActionResult +from pddl_msgs.msg import PDDLPlannerResult +from pddl_msgs.msg import PDDLStep + +PKG = 'pddl_planner' +NAME = 'pddlresulttest' + +class PddlResultChecker(object): + def __init__(self, topic_name, timeout, result): + self.topic_name = topic_name + rospy.loginfo("subscribing {}".format(topic_name)) + self.targets = [] + self.deadline = None + self.add_callback(timeout, result) + self.sub = rospy.Subscriber(topic_name, PDDLPlannerActionResult, self._callback) + + def _callback(self, msg): + + rospy.loginfo("received msg") + rospy.loginfo(" - use_durative_action: {}".format(msg.result.use_durative_action)) + rospy.loginfo(" - sequence: {}".format([x.action + " ".join(x.args) for x in msg.result.sequence])) + rospy.loginfo(" {} {}".format([x.start_time for x in msg.result.sequence], + [x.action_duration for x in msg.result.sequence])) + for target in self.targets: + message_matched = True + result = target['result'] + + if target['msg_matched']: + rospy.loginfo(" msg already passed {}".format([x.action + " ".join(x.args) for x in result.sequence])) + continue + + if not result.use_durative_action == None: + if not msg.result.use_durative_action == result.use_durative_action: + rospy.loginfo(" expecting: {}".format(result.use_durative_action)) + message_matched = False + if not result.sequence == None: + if not msg.result.sequence == result.sequence: + rospy.loginfo(" expecting : {}".format([x.action + " ".join(x.args) for x in result.sequence])) + rospy.loginfo(" {} {}".format([x.start_time for x in result.sequence], + [x.action_duration for x in result.sequence])) + message_matched = False + + if message_matched: + target['msg_matched'] = msg + rospy.loginfo("message matched to {}".format([x.action + " ".join(x.args) for x in result.sequence])) + rospy.loginfo(" {} {}".format([x.start_time for x in result.sequence], + [x.action_duration for x in result.sequence])) + + def add_callback(self, timeout, result): + rospy.loginfo("register to check {}".format([x.action + " ".join(x.args) for x in result.sequence])) + rospy.loginfo(" {} {}".format([x.start_time for x in result.sequence], + [x.action_duration for x in result.sequence])) + rospy.loginfo(" within {} sec".format(timeout)) + + deadline_ = rospy.Time.now() + rospy.Duration(timeout) + self.targets.append({'deadline': deadline_ , 'result': result, 'msg_matched': None}) + if self.deadline: + self.deadline = max(self.deadline, deadline_) + else: + self.deadline = deadline_ + + def assert_published(self): + if all(target['msg_matched'] for target in self.targets): + return True + if rospy.Time.now() > self.deadline: + return False + return None + + +class PddlResultTest(unittest.TestCase): + def __init__(self, *args): + super(self.__class__, self).__init__(*args) + rospy.init_node(NAME) + # scrape rosparam + self.topics = [] + params = rospy.get_param('~topics', []) + for param in params: + if 'name' not in param: + self.fail("'name' field in rosparam is required but not specified.") + topic = {'timeout': 10, 'use_durative_action': False, 'sequence_action': [], 'sequence_start_time': [], 'sequence_duration': []} + topic.update(param) + self.topics.append(topic) + # check if there is at least one topic + if not self.topics: + self.fail('No topic is specified in rosparam.') + + def test_publish(self): + """Test topics are published and messages come""" + use_sim_time = rospy.get_param('/use_sim_time', False) + t_start = time.time() + while not rospy.is_shutdown() and \ + use_sim_time and (rospy.Time.now() == rospy.Time(0)): + rospy.logwarn_throttle( + 1, '/use_sim_time is specified and rostime is 0, /clock is published?') + if time.time() - t_start > 10: + self.fail('Timed out (10s) of /clock publication.') + # must use time.sleep because /clock isn't yet published, so rospy.sleep hangs. + time.sleep(0.1) + # subscribe topics + checkers = [] + for topic in self.topics: + topic_name = topic['name'] + timeout = topic['timeout'] + result = PDDLPlannerResult() + result.use_durative_action = topic['use_durative_action'] + # https://stackoverflow.com/questions/60532658/python-2-vs-python-3-difference-in-map-behavior-with-three-arguments + try: + from itertools import zip_longest + result.sequence = list(map(lambda x: PDDLStep(action = x[0].split()[0], + args = x[0].split()[1:], + start_time = x[1] or '', + action_duration = x[2] or ''), + zip_longest(topic['sequence_action'], + topic['sequence_start_time'], + topic['sequence_duration']))) + except: + result.sequence = map(lambda a, s, d: PDDLStep(action = a.split()[0], + args = a.split()[1:], + start_time = s or '', + action_duration = d or ''), + topic['sequence_action'], + topic['sequence_start_time'], + topic['sequence_duration']) + + # check if already subscribe topic + checker = next((x for x in checkers if x.topic_name == topic_name), None) + if checker == None: + checkers.append(PddlResultChecker(topic_name, timeout, result)) + else: + checker.add_callback(timeout, result) + + deadline = max(checker.deadline for checker in checkers) + # assert + finished_topics = [] + while not rospy.is_shutdown(): + if len(set([topic['name'] for topic in self.topics])) == len(finished_topics): + assert True, 'Check all topics [%s] successfully' % (fnished_topics) + break + for checker in checkers: + if checker.topic_name in finished_topics: + continue # skip topic testing has finished + ret = checker.assert_published() + if ret is None: + continue # skip if there is no test result + finished_topics.append(checker.topic_name) + assert ret, 'Topic [%s] is not published' % (checker.topic_name) + rospy.sleep(0.01) + self.assertTrue(True) + + +if __name__ == '__main__': + import rostest + try: + rostest.run(PKG, NAME, PddlResultTest, sys.argv) + except KeyboardInterrupt: + pass + print("{} exiting".format(PKG)) diff --git a/pddl/pddl_planner/test/repeat.sh b/pddl/pddl_planner/test/repeat.sh new file mode 100755 index 0000000..9f8fe08 --- /dev/null +++ b/pddl/pddl_planner/test/repeat.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +function repeat(){ + for ((i=0;i<$1;i++)); do + eval ${*:2} + done +} + +repeat $@ + diff --git a/pddl/pddl_planner/test/search_object.test b/pddl/pddl_planner/test/search_object.test new file mode 100644 index 0000000..2b88cc5 --- /dev/null +++ b/pddl/pddl_planner/test/search_object.test @@ -0,0 +1,27 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(move-to boxa)', '(open-box boxa)', '(detect boxa)', '(grasp boxa)', '(close-box boxa)', '(move-to end)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(close-box boxa)', '(move-to boxb)', '(open-box boxb)', '(detect boxb)', '(grasp boxb)', '(close-box boxb)', '(move-to end)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(close-box boxb)', '(move-to boxc)', '(open-box boxc)', '(detect boxc)', '(grasp boxc)', '(close-box boxc)', '(move-to end)'] + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(move-to boxa)', '(open-box boxa)', '(detect_f boxa)', '(close-box boxa)', '(move-to boxb)', '(open-box boxb)', '(detect_f boxb)', '(close-box boxb)', '(move-to boxc)', '(open-box boxc)', '(detect_f boxc)', '(close-box boxc)', '(move-to end)'] + + + diff --git a/pddl/pddl_planner/test/simple_failure_torelant.test b/pddl/pddl_planner/test/simple_failure_torelant.test new file mode 100644 index 0000000..ccf7827 --- /dev/null +++ b/pddl/pddl_planner/test/simple_failure_torelant.test @@ -0,0 +1,20 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(look elevator-button)', '(push-button elevator-button)'] + - name: /pddl_planner/result + timeout: 10 + sequence_action: ['(move-to elevator)', '(look elevator-button)', '(push-button elevator-button)'] + + + diff --git a/pddl/pddl_planner/test/simple_metric.test b/pddl/pddl_planner/test/simple_metric.test new file mode 100644 index 0000000..d58edbc --- /dev/null +++ b/pddl/pddl_planner/test/simple_metric.test @@ -0,0 +1,18 @@ + + + + + + + + + topics: + - name: /pddl_planner/result + timeout: 120 + sequence_action: ['(ACT1 OBJ1)', '(ACT2 OBJ1)'] + + + diff --git a/pddl/pddl_planner/test/solve-graph-search.l b/pddl/pddl_planner/test/solve-graph-search.l new file mode 100755 index 0000000..2193bd1 --- /dev/null +++ b/pddl/pddl_planner/test/solve-graph-search.l @@ -0,0 +1,110 @@ +#!/usr/bin/env roseus +;; simplified version of pddl_planner/demos/hanoi/solve-hanoi.l + +(load "package://pddl_planner/src/pddl-result-graph.l") +(load "package://pddl_planner/src/eus-pddl-client.l") + +(setq *action-client* + (instance ros::simple-action-client :init + "pddl_planner" pddl_msgs::PDDLPlannerAction)) +;; +;; problem +;; +;;hanoi tower +(setq *problem* (instance pddl-problem :init :name 'hanoi :domain 'manip)) + +;;使用する変数の宣言 +(send *problem* :objects + '((disk0 . object) + (disk1 . object) + (disk2 . object) + (pole0 . object) + (pole1 . object) + (pole2 . object)) ; 簡単のため使う型は一つのみに + ) ; disk0,1,2 pole0,1,2すべてobject型 + +;;初期条件 +;; disk0 disk1 disk2 +;; pole0 pole1 pole2 +(send *problem* :initial-condition + '((on disk0 pole0) + (on disk1 pole1) + (on disk2 pole2) + (can-be-on disk0 disk1) + (can-be-on disk1 disk2) + (clear disk0) + (clear disk1) + (clear disk2))) + +;;初期条件の追加 +(dolist (dd '(disk0 disk1 disk2)) + (dolist (pp '(pole0 pole1 pole2)) + (send *problem* :add :initial-condition + (list 'can-be-on dd pp)))) + +;;終了条件 +;; +;; disk0 +;; disk1 +;; disk2 +;; pole0 pole1 pole2 +(send *problem* :goal-condition + '((on disk0 disk1) + (on disk1 disk2) + (on disk2 pole2) + (clear pole0) + (clear pole1) + (clear disk0) + )) + +;; +;; domain +;; +(setq *domain* (instance pddl-domain :init :name 'manip)) +(send *domain* :requirements '(:typing)) +(send *domain* :types '(object)) +(send *domain* :predicates '((on ?obj0 ?obj1 - object) + (clear ?obj - object) + (can-be-on ?obj0 ?obj1 - object))) +;;making action +(setq *move* (instance pddl-action :init + :name "move" + :parameters '((?obj ?from ?to object)) + :precondition '((clear ?obj) + (clear ?to) + (on ?obj ?from) + (can-be-on ?obj ?to)) + :effect '((on ?obj ?to) + (not (on ?obj ?from)) + (not (clear ?to)) + (clear ?from)))) +;;add action to domain +(send *domain* :add :action *move*) + + +;; +;; solve planning +;; +(pprint (setq *result* (solve-pddl-planning *domain* *problem*))) +(setq *gr* (make-graph-from-pddl-results (list *result*) :node-name :pprint)) + +(require :unittest "lib/llib/unittest.l") +(init-unit-test) + +(deftest test-graph-solve () + (let (solver path result-path solved-path) + ;; solve graph search + (send *gr* :start-state (elt (send *gr* :nodes) 2)) + (send *gr* :goal-state (elt (send *gr* :nodes) 0)) + (setq solver (instance breadth-first-graph-search-solver :init)) + (setq path (send solver :solve *gr* :verbose nil)) + + (setq result-path (cdr (assoc :plan *result*))) + (setq solved-path (mapcar #'read-from-string (cdr (send-all (send-all path :action) :name)))) + (format *error-output* "result-path ~A~%" result-path) + (format *error-output* "solved-path ~A~%" solved-path) + (assert (equal solved-path result-path)) + )) + +(run-all-tests) +(exit) diff --git a/pddl/pddl_planner/test/test-sample-pddl.test b/pddl/pddl_planner/test/test-sample-pddl.test index a217b74..a16be22 100644 --- a/pddl/pddl_planner/test/test-sample-pddl.test +++ b/pddl/pddl_planner/test/test-sample-pddl.test @@ -23,4 +23,24 @@ + + + + + + + + + diff --git a/pddl/pddl_planner_viewer/CHANGELOG.rst b/pddl/pddl_planner_viewer/CHANGELOG.rst index 1114424..3de8a2d 100644 --- a/pddl/pddl_planner_viewer/CHANGELOG.rst +++ b/pddl/pddl_planner_viewer/CHANGELOG.rst @@ -2,6 +2,9 @@ Changelog for package pddl_planner_viewer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.13 (2023-11-29) +------------------- + 0.1.12 (2020-04-01) ------------------- diff --git a/pddl/pddl_planner_viewer/package.xml b/pddl/pddl_planner_viewer/package.xml index 1f4d22f..7f385d1 100644 --- a/pddl/pddl_planner_viewer/package.xml +++ b/pddl/pddl_planner_viewer/package.xml @@ -1,6 +1,6 @@ pddl_planner_viewer - 0.1.12 + 0.1.13 a viewer of pddl_planner. Ryohei Ueda diff --git a/task_compiler/CHANGELOG.rst b/task_compiler/CHANGELOG.rst index 778c697..fa8858d 100644 --- a/task_compiler/CHANGELOG.rst +++ b/task_compiler/CHANGELOG.rst @@ -2,6 +2,14 @@ Changelog for package task_compiler ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +0.1.13 (2023-11-29) +------------------- +* [task_compiler/samples/failure-recovery-sample]suppress warnings (`#82 `_) +* add time-limit to test_task_compiler (`#95 `_) +* use xdg-open instead of gnome-open (`#91 `_) + +* Contributors: Kei Okada, Naoki Hiraoka, Shingo Kitagawa, Yoshiki Obinata + 0.1.12 (2020-04-01) ------------------- * Set timeout for planning in task_compiler (`#69 `_) diff --git a/task_compiler/euslisp/execute-pddl-core.l b/task_compiler/euslisp/execute-pddl-core.l index 43b2521..760f55a 100755 --- a/task_compiler/euslisp/execute-pddl-core.l +++ b/task_compiler/euslisp/execute-pddl-core.l @@ -47,7 +47,7 @@ (ros::ros-info "output result to /tmp/action_graph.pdf") (when display-graph - (piped-fork "gnome-open /tmp/action_graph.pdf")) + (piped-fork "xdg-open /tmp/action_graph.pdf")) (setq *sm* (convert-smach graph :return-success return-success :return-fail return-fail diff --git a/task_compiler/package.xml b/task_compiler/package.xml index cff83ee..185c88d 100644 --- a/task_compiler/package.xml +++ b/task_compiler/package.xml @@ -1,6 +1,6 @@ task_compiler - 0.1.12 + 0.1.13 task_compiler Compiler that translate task description in PDDL (Planning Domain Description Language) to SMACH (state machine based execution and coordination system) description. diff --git a/task_compiler/samples/clean_planning/si11_pddl.l b/task_compiler/samples/clean_planning/si11_pddl.l index e81c67f..7d5dead 100755 --- a/task_compiler/samples/clean_planning/si11_pddl.l +++ b/task_compiler/samples/clean_planning/si11_pddl.l @@ -176,7 +176,7 @@ (send (make-readable-graph *graph*) :write-to-pdf "knock_demo.pdf") ;(when (ros::get-param "~display_graph") - (piped-fork "gnome-open knock_demo.pdf") + (piped-fork "xdg-open knock_demo.pdf") ;) ;; action definition @@ -202,4 +202,4 @@ ;(when (string= "__log:=" (subseq (car (last lisp::*eustop-argument*)) 0 7)) ; (ros::exit)) -) \ No newline at end of file +) diff --git a/task_compiler/samples/failure-recovery-sample/solve-failure-recovery-task.l b/task_compiler/samples/failure-recovery-sample/solve-failure-recovery-task.l index 285610f..ec3ae70 100755 --- a/task_compiler/samples/failure-recovery-sample/solve-failure-recovery-task.l +++ b/task_compiler/samples/failure-recovery-sample/solve-failure-recovery-task.l @@ -111,14 +111,15 @@ (setq *graph* (make-graph-from-pddl-results (list *result*) :node-name :pprint)) ;; swap nodes ( check_open <-> check_open_f ) for making task flow - (setq *graph* (add-failed-nodes *result* (list 'pick 'put) :graph *graph*)) + (when (< 0 level) + (setq *graph* (add-failed-nodes *result* (list 'pick 'put) :graph *graph*))) (send *graph* :name (send *domain* :name)) (setq *graph* (make-readable-graph *graph*)) (send *graph* :write-to-pdf "action_graph.pdf") (when (ros::get-param "~display_graph") - (piped-fork "gnome-open action_graph.pdf")) + (piped-fork "xdg-open action_graph.pdf")) ;; action definition ;; domain -> package diff --git a/task_compiler/test/test_task_compiler.test b/task_compiler/test/test_task_compiler.test index 84ea586..9d5a43b 100644 --- a/task_compiler/test/test_task_compiler.test +++ b/task_compiler/test/test_task_compiler.test @@ -12,5 +12,6 @@ + args="$(find task_compiler)/test/test-task-compiler.l" + time-limit="180" />