2016-08-30 14:33:45 +08:00
|
|
|
# Copyright 2016 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.
|
|
|
|
|
2020-08-31 21:59:36 +08:00
|
|
|
FROM osrf/ros:kinetic-desktop
|
2016-12-09 22:24:06 +08:00
|
|
|
|
2017-06-14 20:44:16 +08:00
|
|
|
ARG CARTOGRAPHER_VERSION=master
|
|
|
|
|
2018-04-05 16:30:35 +08:00
|
|
|
# We require a GitHub access token to be passed.
|
|
|
|
ARG github_token
|
|
|
|
|
2016-12-09 22:24:06 +08:00
|
|
|
# Xenial's base image doesn't ship with sudo.
|
2020-08-31 21:59:36 +08:00
|
|
|
RUN apt-get update && apt-get install -y sudo
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2020-06-24 16:55:03 +08:00
|
|
|
# First, we invalidate the entire cache if cartographer-project/cartographer has
|
2016-10-25 21:41:00 +08:00
|
|
|
# changed. This file's content changes whenever master changes. See:
|
|
|
|
# http://stackoverflow.com/questions/36996046/how-to-prevent-dockerfile-caching-git-clone
|
2020-06-24 16:55:03 +08:00
|
|
|
ADD https://api.github.com/repos/cartographer-project/cartographer/git/refs/heads/master?access_token=$github_token \
|
2016-10-25 21:41:00 +08:00
|
|
|
cartographer_ros/cartographer_version.json
|
|
|
|
|
2016-10-21 18:37:59 +08:00
|
|
|
# wstool needs the updated rosinstall file to clone the correct repos.
|
|
|
|
COPY cartographer_ros.rosinstall cartographer_ros/
|
2016-10-24 00:16:12 +08:00
|
|
|
COPY scripts/prepare_catkin_workspace.sh cartographer_ros/scripts/
|
2017-06-14 20:44:16 +08:00
|
|
|
RUN CARTOGRAPHER_VERSION=$CARTOGRAPHER_VERSION \
|
|
|
|
cartographer_ros/scripts/prepare_catkin_workspace.sh
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2016-10-21 18:37:59 +08:00
|
|
|
# rosdep needs the updated package.xml files to install the correct debs.
|
2016-10-24 00:16:12 +08:00
|
|
|
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/
|
2016-10-21 18:37:59 +08:00
|
|
|
COPY scripts/install_debs.sh cartographer_ros/scripts/
|
2020-08-31 21:59:36 +08:00
|
|
|
RUN cartographer_ros/scripts/install_debs.sh
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2020-06-25 19:04:21 +08:00
|
|
|
# Install Abseil and proto3.
|
|
|
|
RUN /catkin_ws/src/cartographer/scripts/install_abseil.sh
|
2017-11-13 17:48:00 +08:00
|
|
|
RUN /catkin_ws/src/cartographer/scripts/install_proto3.sh
|
|
|
|
|
2016-12-09 22:24:06 +08:00
|
|
|
# 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.
|
2016-10-24 00:16:12 +08:00
|
|
|
COPY scripts/install.sh cartographer_ros/scripts/
|
2016-12-07 20:12:09 +08:00
|
|
|
COPY scripts/catkin_test_results.sh cartographer_ros/scripts/
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2016-12-09 22:24:06 +08:00
|
|
|
COPY cartographer_ros_msgs catkin_ws/src/cartographer_ros/cartographer_ros_msgs/
|
2016-12-07 20:12:09 +08:00
|
|
|
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
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2017-03-25 00:44:33 +08:00
|
|
|
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
|
|
|
|
|
2016-12-09 22:24:06 +08:00
|
|
|
COPY cartographer_ros catkin_ws/src/cartographer_ros/cartographer_ros/
|
2016-12-07 20:12:09 +08:00
|
|
|
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
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2016-12-09 22:24:06 +08:00
|
|
|
COPY cartographer_rviz catkin_ws/src/cartographer_ros/cartographer_rviz/
|
2016-12-07 20:12:09 +08:00
|
|
|
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
|
2016-10-24 00:16:12 +08:00
|
|
|
|
2016-08-30 14:33:45 +08:00
|
|
|
COPY scripts/ros_entrypoint.sh /
|
2020-08-31 21:59:36 +08:00
|
|
|
|
|
|
|
RUN rm -rf /var/lib/apt/lists/*
|
2016-10-24 00:16:12 +08:00
|
|
|
# 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
|