From f30d1f7e1e763394eb6a724e5d5830f08e9e0a79 Mon Sep 17 00:00:00 2001 From: Michael Grupp Date: Tue, 28 Jul 2020 14:39:55 +0200 Subject: [PATCH] Changes for ROS Noetic support (#1494) Signed-off-by: Michael Grupp --- .travis.yml | 1 + Dockerfile.noetic | 84 ++++++++++++++++++++++++++++++++++++ cartographer_ros/package.xml | 2 +- 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.noetic diff --git a/.travis.yml b/.travis.yml index 17ee656..41286c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ cache: env: - ROS_RELEASE=kinetic DOCKER_CACHE_FILE=/home/travis/docker/kinetic-cache.tar.gz - ROS_RELEASE=melodic DOCKER_CACHE_FILE=/home/travis/docker/melodic-cache.tar.gz + - ROS_RELEASE=noetic DOCKER_CACHE_FILE=/home/travis/docker/noetic-cache.tar.gz before_install: # $GITHUB_TOKEN must be a valid GitHub access token without access rights (https://github.com/settings/tokens). diff --git a/Dockerfile.noetic b/Dockerfile.noetic new file mode 100644 index 0000000..97cf6e1 --- /dev/null +++ b/Dockerfile.noetic @@ -0,0 +1,84 @@ +# Copyright 2020 The Cartographer Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM ros:noetic + +ARG CARTOGRAPHER_VERSION=master + +# We require a GitHub access token to be passed. +ARG github_token + +# Prevent any interaction required by apt-get. +# https://stackoverflow.com/questions/22466255 +ARG DEBIAN_FRONTEND=noninteractive + +# ROS Noetic's base image doesn't ship with sudo and git. +RUN apt-get update && apt-get install -y sudo git && rm -rf /var/lib/apt/lists/* + +# First, we invalidate the entire cache if cartographer-project/cartographer has +# changed. This file's content changes whenever master changes. See: +# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone +ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \ + cartographer_ros/cartographer_version.json + +# wstool needs the updated rosinstall file to clone the correct repos. +COPY cartographer_ros.rosinstall cartographer_ros/ +COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/ +RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \ + cartographer_ros/scripts/prepare_catkin_workspace.sh + +# rosdep needs the updated package.xml files to install the correct debs. +COPY cartographer_ros/package.xml catkin_ws/src/cartographer_ros/cartographer_ros/ +COPY cartographer_ros_msgs/package.xml catkin_ws/src/cartographer_ros/cartographer_ros_msgs/ +COPY cartographer_rviz/package.xml catkin_ws/src/cartographer_ros/cartographer_rviz/ +COPY scripts/install_debs.sh cartographer_ros/scripts/ +RUN cartographer_ros/scripts/install_debs.sh && rm -rf /var/lib/apt/lists/* + +# Install Abseil and proto3. +RUN /catkin_ws/src/cartographer/scripts/install_abseil.sh +RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh + +# Build, install, and test all packages individually to allow caching. The +# ordering of these steps must match the topological package ordering as +# determined by Catkin. +COPY scripts/install.sh cartographer_ros/scripts/ +COPY scripts/catkin_test_results.sh cartographer_ros/scripts/ + +COPY cartographer_ros_msgs catkin_ws/src/cartographer_ros/cartographer_ros_msgs/ +RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs && \ + cartographer_ros/scripts/install.sh --pkg cartographer_ros_msgs \ + --catkin-make-args run_tests && \ + cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros_msgs + +RUN cartographer_ros/scripts/install.sh --pkg ceres-solver + +RUN cartographer_ros/scripts/install.sh --pkg cartographer && \ + cartographer_ros/scripts/install.sh --pkg cartographer --make-args test + +COPY cartographer_ros catkin_ws/src/cartographer_ros/cartographer_ros/ +RUN cartographer_ros/scripts/install.sh --pkg cartographer_ros && \ + cartographer_ros/scripts/install.sh --pkg cartographer_ros \ + --catkin-make-args run_tests && \ + cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_ros + +COPY cartographer_rviz catkin_ws/src/cartographer_ros/cartographer_rviz/ +RUN cartographer_ros/scripts/install.sh --pkg cartographer_rviz && \ + cartographer_ros/scripts/install.sh --pkg cartographer_rviz \ + --catkin-make-args run_tests && \ + cartographer_ros/scripts/catkin_test_results.sh build_isolated/cartographer_rviz + +COPY scripts/ros_entrypoint.sh / +# A BTRFS bug may prevent us from cleaning up these directories. +# https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_cannot_delete_an_empty_directory +RUN rm -rf cartographer_ros catkin_ws || true diff --git a/cartographer_ros/package.xml b/cartographer_ros/package.xml index fe5cc9c..cd64648 100644 --- a/cartographer_ros/package.xml +++ b/cartographer_ros/package.xml @@ -39,7 +39,7 @@ git google-mock protobuf-dev - python-sphinx + python3-sphinx cartographer cartographer_ros_msgs