Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
################################################################################
# Repo

.git/*
.dockerignore
.gitignore
**Dockerfile
**.Dockerfile
174 changes: 174 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
ARG FROM_IMAGE=ros:eloquent

# multi-stage for caching
FROM $FROM_IMAGE AS cache

# clone underlay source
ENV UNDERLAY_WS /opt/underlay_ws
RUN mkdir -p $UNDERLAY_WS/src
WORKDIR $UNDERLAY_WS
COPY ./install/underlay.repos ./
RUN vcs import src < underlay.repos

# copy overlay source
ENV OVERLAY_WS /opt/overlay_ws
RUN mkdir -p $OVERLAY_WS/src
WORKDIR $OVERLAY_WS
COPY ./install/overlay.repos ./
RUN vcs import src < overlay.repos

# copy ros source
ENV ROS_WS /opt/ros_ws
RUN mkdir -p $ROS_WS/src
WORKDIR $ROS_WS
# COPY ./ src/Kimera-VIO-ROS
COPY ./install/ros.repos ./
RUN vcs import src < ros.repos

# copy manifests for caching
WORKDIR /opt
RUN find ./ -name "package.xml" | \
xargs cp --parents -t /tmp
# && find ./ -name "COLCON_IGNORE" | \
# xargs cp --parents -t /tmp

# multi-stage for building
FROM $FROM_IMAGE AS build

# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros1-latest.list

ENV ROS_DISTRO melodic
# ENV ROS2_DISTRO eloquent

# install CI dependencies
RUN apt-get update && apt-get install -q -y \
ccache \
lcov \
ros-$ROS_DISTRO-ros-core \
&& rm -rf /var/lib/apt/lists/*

# install opencv dependencies
RUN apt-get update && apt-get install -y \
gfortran \
libatlas-base-dev \
libgtk-3-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libvtk6-dev \
unzip \
&& rm -rf /var/lib/apt/lists/*

# copy underlay manifests
ENV UNDERLAY_WS /opt/underlay_ws
COPY --from=cache /tmp/underlay_ws $UNDERLAY_WS
WORKDIR $UNDERLAY_WS

# install underlay dependencies
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
apt-get update && rosdep install -q -y \
--from-paths src \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*

# copy underlay source
COPY --from=cache $UNDERLAY_WS ./

# build underlay source
ARG UNDERLAY_MIXINS="release"
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
colcon build \
--symlink-install \
--mixin $UNDERLAY_MIXINS \
--cmake-args \
--no-warn-unused-cli \
-DGTSAM_BUILD_TESTS=OFF \
-DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \
-DGTSAM_BUILD_UNSTABLE=ON \
-DGTSAM_POSE3_EXPMAP=ON \
-DGTSAM_ROT3_EXPMAP=ON \
-DOPENCV_EXTRA_MODULES_PATH=$UNDERLAY_WS/src/opencv/opencv/contrib/modules
# --event-handlers console_direct+

# copy overlay manifests
ENV OVERLAY_WS /opt/overlay_ws
COPY --from=cache /tmp/overlay_ws $OVERLAY_WS
WORKDIR $OVERLAY_WS

# install overlay dependencies
RUN . $UNDERLAY_WS/install/setup.sh && \
apt-get update && rosdep install -q -y \
--from-paths \
src \
$UNDERLAY_WS/src \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*

# copy overlay source
COPY --from=cache $OVERLAY_WS ./

# build overlay source
ARG OVERLAY_MIXINS="release ccache"
RUN . $UNDERLAY_WS/install/setup.sh && \
colcon build \
--symlink-install \
--mixin $OVERLAY_MIXINS \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_CXX_FLAGS="\
-Wno-parentheses \
-Wno-reorder \
-Wno-sign-compare \
-Wno-unused-but-set-variable \
-Wno-unused-function \
-Wno-unused-parameter \
-Wno-unused-value \
-Wno-unused-variable"
# --event-handlers console_direct+

# copy ros manifests
ENV ROS_WS /opt/ros_ws
COPY --from=cache /tmp/ros_ws $ROS_WS
WORKDIR $ROS_WS

# install overlay dependencies
RUN . $OVERLAY_WS/install/setup.sh && \
apt-get update && rosdep install -q -y \
--from-paths \
src \
$UNDERLAY_WS/src \
$OVERLAY_WS/src \
--ignore-src \
--skip-keys "\
Boost" \
&& rm -rf /var/lib/apt/lists/*

# copy overlay source
COPY --from=cache $ROS_WS ./

# build overlay source
ARG ROS_MIXINS="release ccache"
RUN . $OVERLAY_WS/install/setup.sh && \
colcon build \
--symlink-install \
--mixin $ROS_MIXINS \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_CXX_FLAGS="\
-Wno-sign-compare \
-Wno-unused-value \
-Wno-unused-variable \
-Wno-unused-but-set-variable \
-Wno-reorder \
-Wno-parentheses \
-Wno-unused-parameter"
# --event-handlers console_direct+

# source overlay from entrypoint
RUN sed --in-place \
's|^source .*|source "$ROS_WS/install/setup.bash"|' \
/ros_entrypoint.sh
13 changes: 13 additions & 0 deletions install/overlay.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
repositories:
MIT-SPARK/Kimera-RPGO:
type: git
# url: https://github.com/MIT-SPARK/Kimera-RPGO.git
# version: master
url: https://github.com/ruffsl/Kimera-RPGO.git
version: patch-1
MIT-SPARK/Kimera-VIO:
type: git
# url: https://github.com/MIT-SPARK/Kimera-VIO.git
# version: master
url: https://github.com/ruffsl/Kimera-VIO.git
version: patch-3
31 changes: 31 additions & 0 deletions install/ros.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repositories:
MIT-SPARK/Kimera-VIO-ROS:
type: git
# url: https://github.com/MIT-SPARK/Kimera-VIO-ROS.git
# version: master
url: https://github.com/ruffsl/Kimera-VIO-ROS.git
version: patch-1
MIT-SPARK/pose_graph_tools:
type: git
url: https://github.com/MIT-SPARK/pose_graph_tools.git
version: master
ToniRV/mesh_rviz_plugins:
type: git
url: https://github.com/ToniRV/mesh_rviz_plugins.git
version: master
# url: https://github.com/ruffsl/mesh_rviz_plugins.git
# version: patch-1
ToniRV/kimera_rviz_markers:
type: git
url: https://github.com/ToniRV/kimera_rviz_markers.git
version: master
catkin/catkin_simple:
type: git
url: https://github.com/catkin/catkin_simple.git
version: master

# - git:
# local-name: cmake_external_project_catkin
# uri: https://github.com/zurich-eye/cmake_external_project_catkin.git
# version: master

27 changes: 27 additions & 0 deletions install/underlay.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repositories:
borglab/gtsam:
type: git
url: https://github.com/borglab/gtsam.git
version: develop
laurentkneip/opengv:
type: git
# url: https://github.com/laurentkneip/opengv.git
# version: master
url: https://github.com/ruffsl/opengv.git
version: patch-1
dorian3d/DBoW2:
type: git
# url: https://github.com/dorian3d/DBoW2.git
# version: master
url: https://github.com/ruffsl/DBoW2.git
version: patch-1
opencv/opencv:
type: git
# url: https://github.com/opencv/opencv.git
# version: master
url: https://github.com/ruffsl/opencv.git
version: patch-1
opencv/opencv/contrib:
type: git
url: https://github.com/opencv/opencv_contrib.git
version: 3.3.1
6 changes: 3 additions & 3 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<!-- KimeraVIO needs opencv >= 3.3.1, yet ROS uses 3.2.0.
Hacky way of avoiding error in KimeraVIO by linking to 3.4.2-->
<depend>opencv3_catkin</depend>
<depend>libopencv-dev</depend>
<depend>kimera_vio</depend>

<depend>roscpp</depend>
Expand All @@ -29,8 +29,8 @@
<depend>tf</depend>
<depend>pose_graph_tools</depend>

<depend>glog_catkin</depend>
<depend>gflags_catkin</depend>
<depend>libgflags-dev</depend>
<depend>libgoogle-glog-dev</depend>

<depend>pcl_ros</depend>
<depend>pcl_msgs</depend>
Expand Down