diff --git a/.docker/ci/Dockerfile b/.docker/ci/Dockerfile index de2a963dc3..02b21d1452 100644 --- a/.docker/ci/Dockerfile +++ b/.docker/ci/Dockerfile @@ -1,50 +1,30 @@ -# moveit/moveit:melodic-ci -# Sets up a base image to use for running Continuous Integration on Travis +FROM ros:crystal-ros-base-bionic -FROM ros:melodic-ros-base -MAINTAINER Dave Coleman dave@picknik.ai +MAINTAINER Lander Usategui -ENV TERM xterm +ENV ROS_DISTRO crystal +WORKDIR /ros2_ws -# Setup catkin workspace -ENV CATKIN_WS=/root/ws_moveit -WORKDIR $CATKIN_WS - -# Commands are combined in single RUN statement with "apt/lists" folder removal to reduce image size -# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#minimize-the-number-of-layers RUN \ - mkdir src && \ - cd src && \ - # - # Download moveit source, so that we can get necessary dependencies - wstool init --shallow . https://raw.githubusercontent.com/ros-planning/moveit/${ROS_DISTRO}-devel/moveit.rosinstall && \ - # - # Update apt package list as previous containers clear the cache - apt-get -qq update && \ - apt-get -qq dist-upgrade && \ - # - # Install some base dependencies - apt-get -qq install -y \ - # Some source builds require a package.xml be downloaded via wget from an external location + apt-get update && apt-get install -y \ + python3-colcon-common-extensions \ + libboost-all-dev \ + libglew-dev \ + freeglut3-dev \ + pkg-config \ + libfcl-dev \ + libassimp-dev \ + libqhull-dev \ + ros-$ROS_DISTRO-action-msgs \ + ros-$ROS_DISTRO-resource-retriever \ + ros-$ROS_DISTRO-image-transport \ + python3-vcstool \ + libopencv-dev \ wget \ - # Required for rosdep command - sudo \ - # Preferred build tools - python-catkin-tools \ - clang clang-format-3.9 clang-tidy clang-tools \ - ccache && \ - # - # Download all dependencies of MoveIt! - rosdep update && \ - rosdep install -y --from-paths . --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \ - # - # Remove the source code from this container - # TODO: in the future we may want to keep this here for further optimization of later containers - cd .. && \ - rm -rf src/ && \ - # - # Clear apt-cache to reduce image size - rm -rf /var/lib/apt/lists/* - -# Continous Integration Setting -ENV IN_DOCKER 1 + && rm -rf /var/lib/apt/lists/* \ + # Setup ROS2 workspace + && mkdir -p /ros2_ws/src && cd /ros2_ws \ + && wget https://raw.githubusercontent.com/AcutronicRobotics/moveit2/master/external-repos.repos \ + && vcs import src < external-repos.repos +COPY ./docker-entrypoint.sh / +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/.docker/ci/docker-entrypoint.sh b/.docker/ci/docker-entrypoint.sh new file mode 100755 index 0000000000..06f8297c05 --- /dev/null +++ b/.docker/ci/docker-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +/bin/bash -c "find /opt/ros/crystal/ -name tf2_eigen | xargs rm -rf && source /opt/ros/crystal/setup.bash \ + && touch /ros2_ws/src/image_common/camera_calibration_parsers/COLCON_IGNORE \ + && touch /ros2_ws/src/image_common/camera_info_manager/COLCON_IGNORE \ + && colcon build --merge-install" diff --git a/.travis.yml b/.travis.yml index 050c7646d1..d29acb2dc4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,27 @@ -# This config file for Travis CI utilizes https://github.com/ros-planning/moveit_ci/ package. -sudo: required -dist: xenial # distro used by Travis, moveit_ci uses the docker image's distro -services: - - docker -language: cpp -cache: ccache -compiler: gcc - notifications: email: recipients: - - 130s@2000.jukuin.keio.ac.jp -env: - global: - - MOVEIT_CI_TRAVIS_TIMEOUT=85 # Travis grants us 90 min, but we add a safety margin of 5 min - - ROS_DISTRO=melodic - - ROS_REPO=ros - - UPSTREAM_WORKSPACE=moveit.rosinstall - - TEST_BLACKLIST=moveit_ros_perception # mesh_filter_test fails due to broken Mesa OpenGL - - WARNINGS_OK=false - matrix: - - TEST="clang-format catkin_lint" - - TEST=clang-tidy-fix - - ROS_DISTRO=melodic - - ROS_DISTRO=kinetic + - lander@erlerobotics.com + - anasarrak@erlerobotics.com -matrix: # Add a separate config to the matrix, using clang as compiler +matrix: include: - # add a config to the matrix using clang as compiler and also test ikfast plugin creation - - compiler: clang - env: ROS_REPO=ros-shadow-fixed - BEFORE_DOCKER_SCRIPT="source moveit_kinematics/test/test_ikfast_plugins.sh" - - fast_finish: true # finish, even if allow-failure-tests still running - allow_failures: - - env: TEST=clang-tidy-fix # need to fix clang-tidy issues + - os: linux + dist: bionic + services: + - docker + sudo: + - required + - os: osx + osx_image: xcode10.1 before_script: - - git clone -q --depth=1 https://github.com/ros-planning/moveit_ci.git .moveit_ci + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash ./osx-dependencies.sh; fi + - mkdir /tmp/moveit2 + - mv * /tmp/moveit2 + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd .docker/ci; fi script: - - .moveit_ci/travis.sh + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t acutronicrobotics/moveit2 .; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker run -v /tmp/moveit2:/ros2_ws/src/moveit2 acutronicrobotics/moveit2; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash /tmp/moveit2/osx-compile.sh; fi diff --git a/external-repos.repos b/external-repos.repos new file mode 100644 index 0000000000..81dc33a806 --- /dev/null +++ b/external-repos.repos @@ -0,0 +1,61 @@ +repositories: + moveit_msgs: + type: git + url: https://github.com/AcutronicRobotics/moveit_msgs + version: ros2 + geometry2: + type: git + url: https://github.com/AcutronicRobotics/geometry2 + version: master + geometric_shapes: + type: git + url: https://github.com/AcutronicRobotics/geometric_shapes + version: ros2 + eigen_stl_containers: + type: git + url: https://github.com/AcutronicRobotics/eigen_stl_containers + version: ros2 + object_recognition_msgs: + type: git + url: https://github.com/AcutronicRobotics/object_recognition_msgs + version: master + octomap_msgs: + type: git + url: https://github.com/AcutronicRobotics/octomap_msgs + version: ros2 + random_numbers: + type: git + url: https://github.com/AcutronicRobotics/random_numbers + version: ros2 + srdfdom: + type: git + url: https://github.com/AcutronicRobotics/srdfdom + version: ros2 + urdf_parser_py: + type: git + url: https://github.com/AcutronicRobotics/urdf_parser_py + version: ros2 + octomap: + type: git + url: https://github.com/AcutronicRobotics/octomap + version: ros2 + moveit_resources: + type: git + url: https://github.com/AcutronicRobotics/moveit_resources + version: master + console_bridge_vendor: + type: git + url: https://github.com/ros2/console_bridge_vendor + version: crystal + ros1_bridge: + type: git + url: https://github.com/ros2/ros1_bridge + version: master + image_common: + type: git + url: https://github.com/ros-perception/image_common + version: ros2 + angles: + type: git + url: https://github.com/ros/angles + version: ros2 diff --git a/osx-compile.sh b/osx-compile.sh new file mode 100644 index 0000000000..27687ea766 --- /dev/null +++ b/osx-compile.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +#set -x #Debug +set -e #exit on failure + +#Prepare for ros2 +cd /tmp +wget https://github.com/ros2/ros2/releases/download/release-crystal-20190214/ros2-crystal-20190214-macos-amd64.tar.bz2 +tar jxf ros2-crystal-20190214-macos-amd64.tar.bz2 +# Remove tf2_eigen +find ros2-osx/ -name tf2_eigen | xargs rm -rf + +source ros2-osx/setup.bash +mkdir -p /tmp/ros2_ws/src +cp -r /tmp/moveit2 /tmp/ros2_ws/src +cd /tmp/ros2_ws && wget https://raw.githubusercontent.com/AcutronicRobotics/moveit2/master/external-repos.repos +vcs import src < external-repos.repos +export OPENSSL_ROOT_DIR="/usr/local/opt/openssl" +#Ignore packages +touch src/image_common/camera_calibration_parsers/COLCON_IGNORE +touch src/image_common/camera_info_manager/COLCON_IGNORE +colcon build --merge-install diff --git a/osx-dependencies.sh b/osx-dependencies.sh new file mode 100644 index 0000000000..29bcd37a94 --- /dev/null +++ b/osx-dependencies.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +#FROM https://index.ros.org/doc/ros2/Installation/OSX-Development-Setup/ + +brew doctor +brew install cppcheck pcre poco tinyxml openssl asio tinyxml2 log4cxx assimp qhull boost fcl freeglut glew +python3 -m pip install argcomplete catkin_pkg colcon-common-extensions coverage empy flake8 flake8-blind-except \ +flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes \ +git+https://github.com/lark-parser/lark.git@0.7d mock nose pep8 pydocstyle pyparsing setuptools vcstool