feat(slam): add rtabmap_ros

This commit is contained in:
X-lanni
2025-07-14 11:34:38 +08:00
parent 3b6641c1fb
commit 943ce5b06f
1635 changed files with 603092 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
### Docker
* Go to the [wiki](https://github.com/introlab/rtabmap/wiki/Installation#docker) for usage examples and how to build locally the images.
+71
View File
@@ -0,0 +1,71 @@
# Image: introlab3it/rtabmap:bionic
FROM ros:melodic-perception
# Install build dependencies
RUN apt-get update && \
apt-get install -y git software-properties-common ros-melodic-rtabmap-ros && \
apt-get remove -y ros-melodic-rtabmap* && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# GTSAM
RUN add-apt-repository ppa:borglab/gtsam-release-4.0 -y
RUN apt-get update && apt install libgtsam-dev libgtsam-unstable-dev -y && \
apt-get clean && rm -rf /var/lib/apt/lists/
# MRPT # build failed: https://github.com/introlab/rtabmap/actions/runs/7259315306/job/19776230419
#RUN add-apt-repository ppa:joseluisblancoc/mrpt-stable -y
#RUN apt-get update && apt install libmrpt-poses-dev -y && \
# apt-get clean && rm -rf /var/lib/apt/lists/
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
# cmake >=3.14 required
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then apt update && apt install -y wget && apt-get clean && rm -rf /var/lib/apt/lists/ && \
wget -nv https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-aarch64.tar.gz && \
tar -xzf cmake-3.20.0-linux-aarch64.tar.gz && \
rm cmake-3.20.0-linux-aarch64.tar.gz &&\
ln -s ~/cmake-3.20.0-linux-aarch64/bin/cmake ~/cmake; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then apt update && apt install -y wget && apt-get clean && rm -rf /var/lib/apt/lists/ && \
wget -nv https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0-linux-x86_64.tar.gz && \
tar -xzf cmake-3.20.0-linux-x86_64.tar.gz && \
rm cmake-3.20.0-linux-x86_64.tar.gz &&\
ln -s ~/cmake-3.20.0-linux-x86_64/bin/cmake ~/cmake; fi
#commit Aug 6 2020
RUN apt-get update && apt install wget && apt-get clean && rm -rf /var/lib/apt/lists/
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
~/cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r opengv
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
~/cmake -DWITH_OPENGV=ON .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+41
View File
@@ -0,0 +1,41 @@
# Image: introlab3it/rtabmap:android-deps
FROM ubuntu:18.04
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get update && apt-get install -y \
git unzip wget ant cmake \
g++ lib32stdc++6 lib32z1 \
software-properties-common \
freeglut3-dev \
openjdk-8-jdk openjdk-8-jre \
curl
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-sdk/ndk/21.4.7075529
ENV ANDROID_NDK=/opt/android-sdk/ndk/21.4.7075529
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
WORKDIR /root/
# Setup android sdk
RUN wget -nv https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && \
unzip -qq commandlinetools-linux-7583922_latest.zip && \
rm commandlinetools-linux-7583922_latest.zip && \
mkdir $ANDROID_HOME && \
mkdir $ANDROID_HOME/cmdline-tools && \
mv cmdline-tools $ANDROID_HOME/cmdline-tools/latest
# We should use build-tools <=30 to avoid dx missing error
RUN echo y | sdkmanager --install "platform-tools" "platforms;android-23" "platforms;android-24" "platforms;android-26" "platforms;android-30" "build-tools;30.0.3" "ndk;21.4.7075529" && \
rm -r $ANDROID_HOME/tools
# we need <=r25 tools to use "android" command (now deprecated)
RUN wget -nv http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip && \
unzip -qq tools_r25.2.5-linux.zip && \
mv tools $ANDROID_HOME/. && \
rm tools_r25.2.5-linux.zip
ADD deps.bash /root/deps.bash
RUN chmod +x deps.bash
RUN /bin/bash -c "./deps.bash /opt/android"
+164
View File
@@ -0,0 +1,164 @@
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "deps.bash android_install_prefix # Example: setup.bash /opt/android"
exit 1
fi
cpus=-j12
prefix=$1
pwd=$(pwd)
ANDROID_NATIVE_API_LEVEL=23
# Download all dependencies
echo "Downloading cmake... (1/10)"
wget -nv https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.tar.gz
echo "Downloading boost... (2/10)"
wget -nv https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
echo "Downloading eigen... (3/10)"
curl -L https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz -o 3.3.9.tar.gz
echo "Downloading flann... (4/10)"
git clone -b 1.8.4 https://github.com/mariusmuja/flann.git
echo "Downloading gtsam... (5/10)"
git clone https://bitbucket.org/gtborg/gtsam.git
echo "Downloading g2o... (6/10)"
git clone https://github.com/RainerKuemmerle/g2o.git
echo "Downloading VTK... (7/10)"
git clone https://github.com/Kitware/VTK.git
echo "Downloading pcl... (8/10)"
git clone https://github.com/PointCloudLibrary/pcl.git
echo "Downloading opencv_contrib... (9/10)"
git clone https://github.com/opencv/opencv_contrib.git
echo "Downloading opencv... (10/10)"
git clone https://github.com/opencv/opencv.git
# Install directory for all dependencies
mkdir -p $prefix/arm64-v8a
#CMake 3.17 for VTK
echo "Install cmake3.17..."
tar -xzf cmake-3.17.0-Linux-x86_64.tar.gz
rm cmake-3.17.0-Linux-x86_64.tar.gz
# Boost
echo "Install boost..."
tar -xzf boost_1_59_0.tar.gz
cd boost_1_59_0
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/1733253195bc4d4d9b7f9eda1e60628dc1e51429/BoostConfig.cmake.in
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/1733253195bc4d4d9b7f9eda1e60628dc1e51429/CMakeLists.txt
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" ..
make $cpus
make install
cd $pwd
rm -r boost_1_59_0.tar.gz boost_1_59_0
# eigen
echo "Install eigen..."
tar -xzf 3.3.9.tar.gz
cd eigen-3.3.9
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" ..
make $cpus
make install
cd $pwd
rm -r 3.3.9.tar.gz eigen-3.3.9
# FLANN
echo "Install flann..."
cd flann
wget -nv https://gist.githubusercontent.com/matlabbe/cacff9f8271d0c42acd622939a26cab4/raw/85baf4927b32844ebd7f8eccce421bde181cd190/flann_1_8_4_android_fix.patch
git apply flann_1_8_4_android_fix.patch
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" ..
make $cpus
make install
cd $pwd
rm -rf flann
# GTSAM
echo "Install gtsam..."
cd gtsam
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5
# patch
wget -nv https://gist.github.com/matlabbe/726b490c658afd3293f4b3f2f501b863/raw/df09fc8e238a495d66b062d92dc1c1fb20a581e8/gtsam_GKlib_android_fix.patch
git apply gtsam_GKlib_android_fix.patch
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON ..
make $cpus
make install
cd $pwd
rm -rf gtsam
# g2o
echo "Install g2o..."
cd g2o
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF ..
make $cpus
make install
cd $pwd
rm -rf g2o
# VTK
echo "Install VTK..."
cd VTK
git checkout tags/v8.2.0
wget https://gist.github.com/matlabbe/e217259fb8ece9ee6daf5a8f70e896a0/raw/2214b503a537d6431d764526b5b780f07d6f168d/vtk_8_2_0_android_r21_fix.patch
git apply vtk_8_2_0_android_r21_fix.patch
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_ANDROID_BUILD=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DANDROID_ARCH_ABI=arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" ..
make $cpus
cp -r CMakeExternals/Install/vtk-android/* $prefix/arm64-v8a/.
cd $pwd
rm -rf VTK
# PCL
echo "Install pcl..."
cd pcl
git checkout tags/pcl-1.8.0
# patch
wget https://gist.github.com/matlabbe/41812e50e459b2f27b331a2343569e5d/raw/b2fc0c4d1cfffb3a9f2811abae782e317c539bfb/pcl_1_8_0_vtk_android_support.patch
git apply pcl_1_8_0_vtk_android_support.patch
mkdir build
cd build
# do it 2 times because there is a cmake error on the first time and not the second time!?
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_tools=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF ..
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_tools=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF ..
make $cpus
make install
cd $pwd
rm -rf pcl
# make sure opencv is using the shared version of zlib
# see https://github.com/android/ndk/issues/1179
mv $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a.back
# OpenCV
echo "Install OpenCV..."
cd opencv_contrib
git checkout tags/4.5.5
cd $pwd
cd opencv
git checkout tags/4.5.5
mkdir build
cd build
$pwd/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$ANDROID_NATIVE_API_LEVEL -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DOPENCV_EXTRA_MODULES_PATH=$pwd/opencv_contrib/modules -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DBUILD_opencv_structured_light=OFF -DBUILD_ANDROID_PROJECTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DBUILD_ANDROID_EXAMPLES=OFF -DWITH_PROTOBUF=OFF -DBUILD_opencv_stereo=OFF -DBUILD_JAVA=OFF -DWITH_QUIRC=OFF -DBUILD_opencv_js_bindings_generator=OFF -DBUILD_opencv_objc_bindings_generator=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_xobjdetect=OFF ..
make $cpus
make install
cd $pwd
rm -rf opencv opencv_contrib
echo "Strip libraries..."
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip -g -S -d --strip-debug --verbose /opt/android/arm64-v8a/lib/*.a
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip -g -S -d --strip-debug --verbose /opt/android/arm64-v8a/sdk/native/staticlibs/arm64-v8a/*.a
@@ -0,0 +1,13 @@
# Image: introlab3it/rtabmap:androidXX
FROM introlab3it/rtabmap:android-deps
ARG API_VERSION=23
# Copy current source code
COPY . /root/rtabmap-tango
WORKDIR /root/rtabmap-tango
RUN /bin/bash -c "./docker/bionic/android/rtabmap_apiXX/rtabmap.bash /opt/android $API_VERSION"
+60
View File
@@ -0,0 +1,60 @@
#!/bin/bash
set -e
if [ $# -ne 2 ]; then
echo "rtabmap.bash android_install_prefix api_level (23 for tango, 24 for arengine) # Example: build.bash /opt/android 24"
exit 1
fi
prefix=$1
api=$2
# tango
wget 'https://docs.google.com/uc?authuser=0&id=12rHHkYM5k-UnQn-xGXs9JqYWhSXrgJr3&export=download' -O TangoSDK_Ikariotikos_C.zip
unzip -qq TangoSDK_Ikariotikos_C.zip
rm TangoSDK_Ikariotikos_C.zip
cp -r lib_tango_client_api/include/* $prefix/arm64-v8a/include/.
cp -r lib_tango_client_api/lib/arm64-v8a/* $prefix/arm64-v8a/lib/.
rm -r lib_tango_client_api
wget 'https://docs.google.com/uc?authuser=0&id=1AqVuEVu5284X6OgrGWu12VTrx4pY99Jb&export=download' -O TangoSupport_Ikariotikos_C.zip
unzip -qq TangoSupport_Ikariotikos_C.zip
rm TangoSupport_Ikariotikos_C.zip
cp -r lib_tango_support_api/include/* $prefix/arm64-v8a/include/.
cp -r lib_tango_support_api/lib/arm64-v8a/* $prefix/arm64-v8a/lib/.
rm -r lib_tango_support_api
wget 'https://docs.google.com/uc?authuser=0&id=1s5iPJ7xiridj9Jj--gCy2XiQFniheVm6&export=download' -O TangoSDK_Ikariotikos_Java.jar
mv TangoSDK_Ikariotikos_Java.jar app/android/libs/.
# ARCore
wget 'https://docs.google.com/uc?authuser=0&id=1VsibeqRYpS5pjmrG-vYTXyiPg8kbIfVN&export=download' -O arcore.zip
unzip -qq arcore.zip
rm arcore.zip
cp -r arcore1_18/include/* $prefix/arm64-v8a/include/.
cp -r arcore1_18/arm64-v8a/* $prefix/arm64-v8a/lib/.
cp arcore1_18/*.jar app/android/libs/.
rm -r arcore1_18
# AREngine
wget 'https://docs.google.com/uc?authuser=0&id=1rdaD2Z1QBv-SUeUy0oBmg3C2odfxTHgR&export=download' -O arengine.zip
unzip -qq arengine.zip
rm arengine.zip
cp -r arengine/include/* $prefix/arm64-v8a/include/.
cp -r arengine/arm64-v8a/* $prefix/arm64-v8a/lib/.
cp arengine/*.jar app/android/libs/.
rm -r arengine
# resource tool
cd build
/root/cmake-3.17.0-Linux-x86_64/bin/cmake -DANDROID_PREBUILD=ON ..
make
# rtabmap
mkdir arm64-v8a
cd arm64-v8a
/root/cmake-3.17.0-Linux-x86_64/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$api -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF -DOpenCV_DIR=$prefix/arm64-v8a/sdk/native/jni ../..
make
make clean
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker build --build-arg CACHE_DATE="$(date)" --cache-from $IMAGE_NAME -f $DOCKERFILE_PATH -t $IMAGE_NAME -t $DOCKER_REPO:18.04 .
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker push $DOCKER_REPO:18.04
+37
View File
@@ -0,0 +1,37 @@
# Image: introlab3it/rtabmap:focal-foxy
FROM introlab3it/rtabmap:focal-foxy-deps
# June 19 2023: moved opengv here so that focal-foxy-deps can be built on my computer. Not sure why but on my machine opengv arm64 fails, but not on CI.
#commit Aug 6 2020
RUN apt-get update && apt install -y wget && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r opengv
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_ALICE_VISION=ON -DWITH_OPENGV=ON .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+176
View File
@@ -0,0 +1,176 @@
# Image: introlab3it/rtabmap:focal-foxy-deps
FROM ubuntu:20.04
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe && \
apt update && \
apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y git ros-foxy-ros-base python3-argcomplete ros-dev-tools ros-foxy-rtabmap-ros && \
apt-get remove -y ros-foxy-rtabmap && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# GTSAM
RUN add-apt-repository ppa:borglab/gtsam-release-4.0 -y
RUN apt-get update && apt install libgtsam-dev libgtsam-unstable-dev -y && \
apt-get clean && rm -rf /var/lib/apt/lists/
# MRPT
RUN add-apt-repository ppa:joseluisblancoc/mrpt-stable -y
RUN apt-get update && apt install libmrpt-poses-dev -y && \
apt-get clean && rm -rf /var/lib/apt/lists/
# PDAL
RUN apt-get update && apt-get install -y libpdal-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/
# RealSense2
RUN apt-get update && apt-get install -y ros-foxy-librealsense2 && \
apt-get clean && rm -rf /var/lib/apt/lists/
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
# Azure Kinect DK
# Taken from https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1190#issuecomment-822772494
# K4A binaries on 20.04 not released yet, we should take those from 18.04
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing k4a..." && \
apt-get update && apt-get install -y curl && \
echo "Download libk4a1.3_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3/libk4a1.3_1.3.0_amd64.deb > /tmp/libk4a1.3_1.3.0_amd64.deb && \
echo "Download libk4a1.3-dev_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3-dev/libk4a1.3-dev_1.3.0_amd64.deb > /tmp/libk4a1.3-dev_1.3.0_amd64.deb && \
echo "Download libk4abt1.0_1.0.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0/libk4abt1.0_1.0.0_amd64.deb > /tmp/libk4abt1.0_1.0.0_amd64.deb && \
echo "Download libk4abt1.0-dev_1.0.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0-dev/libk4abt1.0-dev_1.0.0_amd64.deb > /tmp/libk4abt1.0-dev_1.0.0_amd64.deb && \
echo "Download k4a-tools_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/k/k4a-tools/k4a-tools_1.3.0_amd64.deb > /tmp/k4a-tools_1.3.0_amd64.deb && \
echo "Accept license..." && \
echo 'libk4a1.3 libk4a1.3/accepted-eula-hash string 0f5d5c5de396e4fee4c0753a21fee0c1ed726cf0316204edda484f08cb266d76' | debconf-set-selections && \
echo 'libk4abt1.0 libk4abt1.0/accepted-eula-hash string 03a13b63730639eeb6626d24fd45cf25131ee8e8e0df3f1b63f552269b176e38' | debconf-set-selections && \
dpkg -i /tmp/libk4a1.3_1.3.0_amd64.deb && \
dpkg -i /tmp/libk4a1.3-dev_1.3.0_amd64.deb && \
dpkg -i /tmp/libk4abt1.0_1.0.0_amd64.deb && \
dpkg -i /tmp/libk4abt1.0-dev_1.0.0_amd64.deb && \
apt-get install -y libsoundio1 && \
dpkg -i /tmp/k4a-tools_1.3.0_amd64.deb && \
rm /tmp/libk4a* /tmp/k4a* && \
apt-get clean && rm -rf /var/lib/apt/lists/; fi
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install -y libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r zed-open-capture; fi
# AliceVision v2.4.0 modified (Sept 13 2021)
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing AliceVision..." && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsuitesparse-dev \
libceres-dev \
xorg-dev \
libglu1-mesa-dev \
wget && apt-get clean && rm -rf /var/lib/apt/lists/; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/OpenImageIO/oiio.git && \
cd oiio && \
git checkout Release-2.0.12 && \
mkdir build && \
cd build && \
cmake -DUSE_PYTHON=OFF -DOIIO_BUILD_TESTS=OFF -DOIIO_BUILD_TOOLS=OFF .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r oiio; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/assimp/assimp.git && \
cd assimp && \
git checkout 71a87b653cd4b5671104fe49e2e38cf5dd4d8675 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r assimp; fi
# Ignore assimp installed from ros, as it has invalid "/usr/lib/include" in its target, making rtabmap's cmake fails
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then rm -rf /usr/lib/x86_64-linux-gnu/cmake/assimp*; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/alicevision/geogram.git && \
cd geogram && \
git checkout v1.7.6 && \
wget https://gist.githubusercontent.com/matlabbe/1df724465106c056ca4cc195c81d8cf0/raw/b3ed4cb8f9b270833a40d57d870a259eabfa4415/geogram_8b2ae61.patch && \
git apply geogram_8b2ae61.patch && \
./configure.sh && \
cd build/Linux64-gcc-dynamic-Release && \
make -j$(nproc) && \
make install && \
cd && \
rm -r geogram; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/alicevision/AliceVision.git --recursive && \
cd AliceVision && \
git checkout 0f6115b6af6183c524aa7fcf26141337c1cf3872 && \
git submodule update -i && \
wget https://gist.githubusercontent.com/matlabbe/1df724465106c056ca4cc195c81d8cf0/raw/b3ed4cb8f9b270833a40d57d870a259eabfa4415/alicevision_0f6115b.patch && \
git apply alicevision_0f6115b.patch && \
mkdir build && \
cd build && \
cmake -DALICEVISION_USE_CUDA=OFF -DALICEVISION_USE_APRILTAG=OFF -DALICEVISION_BUILD_SOFTWARE=OFF .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r AliceVision; fi
RUN git clone --branch 4.2.0 https://github.com/opencv/opencv.git && \
git clone --branch 4.2.0 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
COPY ./docker/focal-foxy/deps/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
# setup ros2 environment
source "/opt/ros/foxy/setup.bash" --
exec "$@"
+19
View File
@@ -0,0 +1,19 @@
# Image: introlab3it/rtabmap:focal
FROM introlab3it/rtabmap:focal-deps
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_ALICE_VISION=ON -DWITH_OPENGV=ON .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+196
View File
@@ -0,0 +1,196 @@
# Image: introlab3it/rtabmap:focal
FROM ros:noetic-perception
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /root/
# issue: https://github.com/introlab/rtabmap/issues/1523
RUN rm /etc/apt/sources.list.d/ros1-latest.list || true && \
apt-get update && apt-get install -y curl && \
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' && \
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - && \
apt-get clean && rm -rf /var/lib/apt/lists/
# Install build dependencies
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
apt-get update && \
apt-get install -y git software-properties-common libtbb-dev zlib1g-dev liboctomap-dev ros-noetic-visualization-msgs ros-noetic-velodyne-pointcloud ros-noetic-turtlebot3-navigation ros-noetic-turtlebot3-bringup ros-noetic-tf-conversions ros-noetic-tf2-ros ros-noetic-tf ros-noetic-stereo-msgs ros-noetic-std-srvs ros-noetic-std-msgs ros-noetic-sensor-msgs ros-noetic-rviz ros-noetic-rospy ros-noetic-roscpp ros-noetic-robot-localization ros-noetic-realsense2-camera qtbase5-dev libproj-dev ros-noetic-pluginlib ros-noetic-pcl-ros ros-noetic-pcl-conversions ros-noetic-octomap-msgs ros-noetic-nodelet ros-noetic-nav-msgs ros-noetic-move-base-msgs ros-noetic-message-runtime ros-noetic-message-generation ros-noetic-message-filters libsqlite3-dev libqt5widgets5 libqt5core5a libpcl-dev ros-noetic-libg2o ros-noetic-laser-geometry ros-noetic-imu-filter-madgwick ros-noetic-image-transport ros-noetic-image-geometry ros-noetic-husky-navigation ros-noetic-hector-mapping ros-noetic-gtsam ros-noetic-grid-map-ros ros-noetic-grid-map-core ros-noetic-geometry-msgs ros-noetic-genmsg ros-noetic-find-object-2d ros-noetic-eigen-conversions ros-noetic-dynamic-reconfigure ros-noetic-diagnostic-updater ros-noetic-cv-bridge ros-noetic-costmap-2d ros-noetic-catkin ros-noetic-apriltag-ros ros-noetic-actionlib-msgs ros-noetic-actionlib wget libfreenect-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ ;fi
RUN if [ "$TARGETPLATFORM" != "linux/arm/v7" ]; then \
apt-get update && \
apt-get install -y git software-properties-common libtbb-dev libfreenect-dev ros-noetic-rtabmap-ros && \
apt-get remove -y ros-noetic-rtabmap* && \
apt-get clean && rm -rf /var/lib/apt/lists/ ;fi
#https://gitlab.kitware.com/cmake/cmake/-/issues/20568
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
wget -nv https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz && \
tar -xzf cmake-3.20.0.tar.gz && \
cd cmake-3.20.0 && \
export CFLAGS="-D_FILE_OFFSET_BITS=64" && \
export CXXFLAGS="-D_FILE_OFFSET_BITS=64" && \
./bootstrap && \
make -j4 && \
sudo make install && \
cd .. && \
cmake --version && \
rm -r cmake-3.20.0.tar.gz cmake-3.20.0 ;fi
# MRPT
RUN add-apt-repository ppa:joseluisblancoc/mrpt-stable -y
RUN apt-get update && apt install libmrpt-poses-dev -y && \
apt-get clean && rm -rf /var/lib/apt/lists/
# PDAL
RUN apt-get update && apt-get install -y libpdal-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/
# RealSense2
RUN apt-get update && apt-get install -y ros-noetic-librealsense2 && \
apt-get clean && rm -rf /var/lib/apt/lists/
# Azure Kinect DK
# Taken from https://github.com/microsoft/Azure-Kinect-Sensor-SDK/issues/1190#issuecomment-822772494
# K4A binaries on 20.04 not released yet, we should take those from 18.04
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing k4a..." && \
apt-get update && \
echo "Download libk4a1.3_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3/libk4a1.3_1.3.0_amd64.deb > /tmp/libk4a1.3_1.3.0_amd64.deb && \
echo "Download libk4a1.3-dev_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4a1.3-dev/libk4a1.3-dev_1.3.0_amd64.deb > /tmp/libk4a1.3-dev_1.3.0_amd64.deb && \
echo "Download libk4abt1.0_1.0.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0/libk4abt1.0_1.0.0_amd64.deb > /tmp/libk4abt1.0_1.0.0_amd64.deb && \
echo "Download libk4abt1.0-dev_1.0.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/libk/libk4abt1.0-dev/libk4abt1.0-dev_1.0.0_amd64.deb > /tmp/libk4abt1.0-dev_1.0.0_amd64.deb && \
echo "Download k4a-tools_1.3.0_amd64.deb..." && \
curl -sSL https://packages.microsoft.com/ubuntu/18.04/prod/pool/main/k/k4a-tools/k4a-tools_1.3.0_amd64.deb > /tmp/k4a-tools_1.3.0_amd64.deb && \
echo "Accept license..." && \
echo 'libk4a1.3 libk4a1.3/accepted-eula-hash string 0f5d5c5de396e4fee4c0753a21fee0c1ed726cf0316204edda484f08cb266d76' | debconf-set-selections && \
echo 'libk4abt1.0 libk4abt1.0/accepted-eula-hash string 03a13b63730639eeb6626d24fd45cf25131ee8e8e0df3f1b63f552269b176e38' | debconf-set-selections && \
dpkg -i /tmp/libk4a1.3_1.3.0_amd64.deb && \
dpkg -i /tmp/libk4a1.3-dev_1.3.0_amd64.deb && \
dpkg -i /tmp/libk4abt1.0_1.0.0_amd64.deb && \
dpkg -i /tmp/libk4abt1.0-dev_1.0.0_amd64.deb && \
apt-get install -y libsoundio1 && \
dpkg -i /tmp/k4a-tools_1.3.0_amd64.deb && \
rm /tmp/libk4a* /tmp/k4a* && \
apt-get clean && rm -rf /var/lib/apt/lists/; fi
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake .. && \
make -j4 && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake .. && \
make -j4 && \
make install && \
cd && \
rm -r zed-open-capture; fi
# AliceVision v2.4.0 modified (Sept 13 2021)
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing AliceVision..." && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libsuitesparse-dev \
libceres-dev \
xorg-dev \
libglu1-mesa-dev \
wget && apt-get clean && rm -rf /var/lib/apt/lists/; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/OpenImageIO/oiio.git && \
cd oiio && \
git checkout Release-2.0.12 && \
mkdir build && \
cd build && \
cmake -DUSE_PYTHON=OFF -DOIIO_BUILD_TESTS=OFF -DOIIO_BUILD_TOOLS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -r oiio; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/assimp/assimp.git && \
cd assimp && \
git checkout 71a87b653cd4b5671104fe49e2e38cf5dd4d8675 && \
mkdir build && \
cd build && \
cmake .. && \
make -j4 && \
make install && \
cd && \
rm -r assimp; fi
# Ignore assimp installed from ros, as it has invalid "/usr/lib/include" in its target, making rtabmap's cmake fails
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then rm -rf /usr/lib/x86_64-linux-gnu/cmake/assimp*; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/alicevision/geogram.git && \
cd geogram && \
git checkout v1.7.6 && \
wget https://gist.githubusercontent.com/matlabbe/1df724465106c056ca4cc195c81d8cf0/raw/b3ed4cb8f9b270833a40d57d870a259eabfa4415/geogram_8b2ae61.patch && \
git apply geogram_8b2ae61.patch && \
./configure.sh && \
cd build/Linux64-gcc-dynamic-Release && \
make -j4 && \
make install && \
cd && \
rm -r geogram; fi
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then git clone https://github.com/alicevision/AliceVision.git --recursive && \
cd AliceVision && \
git checkout 0f6115b6af6183c524aa7fcf26141337c1cf3872 && \
git submodule update -i && \
wget https://gist.githubusercontent.com/matlabbe/1df724465106c056ca4cc195c81d8cf0/raw/5e3437cf6229c8d534bbaee475ed9bcb92eb84a1/alicevision_0f6115b.patch && \
git apply alicevision_0f6115b.patch && \
mkdir build && \
cd build && \
cmake -DALICEVISION_USE_CUDA=OFF -DALICEVISION_USE_APRILTAG=OFF -DALICEVISION_BUILD_SOFTWARE=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -r AliceVision; fi
RUN git clone --branch 4.2.0 https://github.com/opencv/opencv.git && \
git clone --branch 4.2.0 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake -DWITH_TBB=ON -DWITH_OPENMP=ON -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DWITH_VTK=OFF -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then apt-get update && apt install wget && apt-get clean && rm -rf /var/lib/apt/lists/; fi
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r opengv
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
+80
View File
@@ -0,0 +1,80 @@
# cd rtabmap
# docker build -t rtabmap_frontiers -f docker/frontiers2022/Dockerfile .
FROM nvcr.io/nvidia/pytorch:22.08-py3
ENV DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN apt-get update && apt-get install -y \
libsqlite3-dev \
libpcl-dev \
git \
cmake \
libyaml-cpp-dev \
software-properties-common \
pkg-config \
wget \
libsuitesparse-dev \
pybind11-dev
# g2o (removing config because cs.h not found error: https://github.com/introlab/rtabmap/issues/835)
RUN git clone https://github.com/RainerKuemmerle/g2o.git && \
cd g2o && \
git checkout 20201223_git && \
mkdir build && \
cd build && \
cmake -DBUILD_LGPL_SHARED_LIBS=ON -DG2O_BUILD_APPS=OFF -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd /workspace && \
rm -rf g2o /usr/local/lib/cmake/g2o
# GTSAM
RUN add-apt-repository ppa:borglab/gtsam-release-4.0 && \
apt install -y libgtsam-dev libgtsam-unstable-dev
# OpenCV with xfeatures2d and nonfree modules
RUN git clone https://github.com/opencv/opencv_contrib.git && \
git clone https://github.com/opencv/opencv.git && \
cd opencv_contrib && \
git checkout tags/4.2.0 && \
cd /workspace && \
cd opencv && \
git checkout tags/4.2.0 && \
mkdir build && \
cd build && \
cmake -DOPENCV_EXTRA_MODULES_PATH=/workspace/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON .. && \
make -j$(nproc) && \
make install && \
cd /workspace && \
rm -rf opencv opencv_contrib
# Copy current source code
COPY . rtabmap
RUN cp -r rtabmap/archive/2022-IlluminationInvariant/scripts scripts && \
chmod +x scripts/*.sh
# Superpoint model
RUN cd scripts && \
wget https://github.com/magicleap/SuperPointPretrainedNetwork/raw/master/superpoint_v1.pth && \
wget https://raw.githubusercontent.com/magicleap/SuperPointPretrainedNetwork/master/demo_superpoint.py && \
python trace.py && \
rm superpoint_v1.pth demo_superpoint.py
# Superglue
RUN cd scripts && \
git clone https://github.com/magicleap/SuperGluePretrainedNetwork && \
cp /workspace/rtabmap/corelib/src/python/rtabmap_superglue.py SuperGluePretrainedNetwork/.
# Build RTAB-Map
RUN cd rtabmap && \
cd build && \
cmake -DTorch_DIR=/opt/conda/lib/python3.8/site-packages/torch/share/cmake/Torch -DWITH_TORCH=ON -DWITH_PYTHON=ON -DWITH_QT=ON .. && \
make -j$(nproc) && \
make install && \
cd /workspace && \
rm -rf rtabmap
+37
View File
@@ -0,0 +1,37 @@
# Image: introlab3it/rtabmap:jammy-iron
FROM introlab3it/rtabmap:jammy-iron-deps
# June 19 2023: moved opengv here so that jammy-deps can be built on my computer. Not sure why but on my machine opengv arm64 fails, but not on CI.
#commit Aug 6 2020
RUN apt-get update && apt install -y wget && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r opengv
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_OPENGV=ON .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+88
View File
@@ -0,0 +1,88 @@
# Image: introlab3it/rtabmap:jammy-iron-deps
FROM ubuntu:22.04
# Install ROS2
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe && \
apt update && \
apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y git libtbb-dev ros-iron-ros-base ros-dev-tools ros-iron-rtabmap-ros && \
apt-get remove -y ros-iron-rtabmap* && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# PDAL
RUN apt-get update && apt-get install -y libpdal-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/
# RealSense2
RUN apt-get update && apt-get install -y ros-iron-librealsense2 && \
apt-get clean && rm -rf /var/lib/apt/lists/
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install -y libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r zed-open-capture; fi
RUN git clone --branch 4.5.4 https://github.com/opencv/opencv.git && \
git clone --branch 4.5.4 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake -DWITH_TBB=ON -DWITH_OPENMP=ON -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
COPY ./docker/jammy-iron/deps/ros_entrypoint.sh /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
# ros2 seems not sourcing by default its multi-arch folders
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/iron/lib/x86_64-linux-gnu:/opt/ros/iron/lib/aarch64-linux-gnu
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
@@ -0,0 +1,6 @@
#!/bin/bash
set -e
# setup ros2 environment
source "/opt/ros/iron/setup.bash" --
exec "$@"
+20
View File
@@ -0,0 +1,20 @@
# Image: introlab3it/rtabmap:jammy
FROM introlab3it/rtabmap:jammy-deps
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_OPENGV=ON .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+109
View File
@@ -0,0 +1,109 @@
# Image: introlab3it/rtabmap:jammy-deps
FROM ubuntu:22.04
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
# Install ROS2
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe && \
apt update && \
apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y git libtbb-dev ros-humble-ros-base ros-dev-tools && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y libfreenect-dev ros-humble-rtabmap-ros && \
apt-get remove -y ros-humble-rtabmap* ros-humble-grid-map-core && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# PDAL
RUN apt-get update && apt-get install -y libpdal-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/
# RealSense2
RUN apt-get update && apt-get install -y ros-humble-librealsense2 && \
apt-get clean && rm -rf /var/lib/apt/lists/
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake .. && \
make -j2 && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install -y libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake .. && \
make -j2 && \
make install && \
cd && \
rm -r zed-open-capture; fi
RUN git clone --branch 4.5.4 https://github.com/opencv/opencv.git && \
git clone --branch 4.5.4 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake -DWITH_TBB=ON -DWITH_OPENMP=ON -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j2 && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
#commit Aug 6 2020
RUN apt-get update && apt install -y wget && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j2 && \
make install && \
cd && \
rm -r opengv
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo -e '#!/bin/bash\nset -e\n\n# setup ros2 environment\nsource "/opt/ros/humble/setup.bash" --\nexec "$@"' > /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
# ros2 seems not sourcing by default its multi-arch folders
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib/aarch64-linux-gnu
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
+230
View File
@@ -0,0 +1,230 @@
# Image: introlab3it/rtabmap:jfr2018
FROM ubuntu:16.04
WORKDIR /root/
# Install build dependencies
RUN apt-get update && apt-get install -y \
libsqlite3-dev \
libpcl-dev \
git \
cmake \
libproj-dev \
libqt5svg5-dev \
libfreenect-dev \
libopenni2-dev \
libyaml-cpp-dev \
software-properties-common \
libgtk2.0-dev \
pkg-config
# OpenCV (use version <= 3.1.0 for rtabmap 0.16.3 for a solvePnpRansac issue where we have worst ransac performance on newer opencv versions)
RUN git clone https://github.com/opencv/opencv_contrib.git
RUN git clone https://github.com/opencv/opencv.git
RUN cd opencv_contrib && \
git checkout tags/3.1.0 && \
cd && \
cd opencv && \
git checkout tags/3.1.0 && \
mkdir build && \
cd build && \
cmake -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -rf opencv opencv_contrib
# Install ROS to build other odometry approaches (depending on ROS)
# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# install ros packages
ENV ROS_DISTRO kinetic
RUN apt-get update && apt-get install -y \
ros-kinetic-ros-core=1.3.2-0* \
&& rm -rf /var/lib/apt/lists/*
# install ROS dependencies
RUN apt-get update && apt-get install -y ros-kinetic-tf ros-kinetic-pcl-ros ros-kinetic-eigen-conversions ros-kinetic-tf-conversions ros-kinetic-random-numbers ros-kinetic-image-transport libblas-dev liblapack-dev libsuitesparse-dev libvtk6.2 libyaml-cpp-dev wget libgoogle-glog-dev libatlas-base-dev ros-kinetic-sophus ros-kinetic-octomap libglew-dev
# g2o should be built to link on csparse installed system-wide (for rtabmap 0.17.4 build below)
RUN git clone https://github.com/RainerKuemmerle/g2o.git
RUN cd g2o && \
git checkout 20170730_git && \
mkdir build && \
cd build && \
cmake -DBUILD_LGPL_SHARED_LIBS=ON -DG2O_BUILD_APPS=OFF -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r g2o
# GTSAM
RUN git clone https://bitbucket.org/gtborg/gtsam.git
RUN cd gtsam && \
git checkout 4.0.0-alpha2 && \
mkdir build && \
cd build && \
cmake -DMETIS_SHARED=ON -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r gtsam
# libpointmatcher
RUN git clone https://github.com/ethz-asl/libnabo.git
#commit Apr 25 2018
RUN cd libnabo && \
git checkout 7e378f6765393462357b8b74d8dc8c5554542ae6 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libnabo
RUN git clone https://github.com/ethz-asl/libpointmatcher.git
#commit Jan 19 2018
RUN cd libpointmatcher && \
git checkout 00004bd41e44a1cf8de24ad87e4914760717cbcc && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libpointmatcher
# Clone dependencies
RUN mkdir -p catkin_ws/src
WORKDIR /root/catkin_ws/src
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; catkin_init_workspace'
RUN git clone https://github.com/tum-vision/dvo_slam.git && cd dvo_slam && git checkout kinetic-devel && rm dvo_slam/package.xml && rm dvo_benchmark/package.xml && rm dvo_ros/package.xml
RUN git clone https://github.com/srv/viso2.git && cd viso2 && git checkout kinetic
RUN git clone https://github.com/KumarRobotics/msckf_vio.git && cd msckf_vio && git checkout a9386c5 && wget https://gist.githubusercontent.com/matlabbe/f2518d7427e7f6740af2110e540b1f2b/raw/1b7c96b38e063bacfa77408686e4528f3d27af2e/msckf_vio_a9386c5_ros_commented.patch && git apply --ignore-space-change --ignore-whitespace msckf_vio_a9386c5_ros_commented.patch
RUN git clone https://github.com/srv/libfovis.git && cd libfovis && git checkout db2fc39451e59317cf8486d92085da1c8e414785
RUN git clone https://github.com/ros-perception/vision_opencv.git && cd vision_opencv && git checkout kinetic
RUN git clone https://github.com/laboshinl/loam_velodyne.git && cd loam_velodyne && git checkout a4c364a677647f2a35831439032dc5a58378b3fd
WORKDIR /root
RUN git clone https://github.com/ethz-asl/okvis.git && cd okvis && git checkout 1dce9129f22dd4d21d944788cd9da3a4341586aa && wget https://gist.githubusercontent.com/matlabbe/383be55b5cb682fea217d45ef9a37ef8/raw/3dfc07f3b0b21d07c090f4bb81950f013163f9cf/okvis_1dce912_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace okvis_1dce912_marchnative_disabled.patch
RUN git clone https://github.com/introlab/rtabmap.git && cd rtabmap && git checkout 0.16.3 && wget https://gist.githubusercontent.com/matlabbe/54c69e8c1008d2b3c237f335cb8a6c99/raw/1dc18f66930be3257ab6d93e80a4ce87d0f110bf/rtabmap-0.16.3-euroc-tool-fix.patch && git apply --ignore-space-change --ignore-whitespace rtabmap-0.16.3-euroc-tool-fix.patch
RUN git clone https://github.com/stevenlovegrove/Pangolin.git
RUN git clone https://github.com/raulmur/ORB_SLAM2.git && cd ORB_SLAM2 && wget https://gist.githubusercontent.com/matlabbe/c10403c5d44af85cc3585c0e1c601a60/raw/48adf04098960d86ddf225f1a8c68af87bfcf56e/orbslam2_f2e6f51_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace orbslam2_f2e6f51_marchnative_disabled.patch
# for dvo, TBB is required (docker related issue)
# Download and install TBB
ENV TBB_RELEASE 2018_U2
ENV TBB_VERSION 2018_20171205
ENV TBB_DOWNLOAD_URL https://github.com/01org/tbb/releases/download/${TBB_RELEASE}/tbb${TBB_VERSION}oss_lin.tgz
ENV TBB_INSTALL_DIR /opt
RUN wget ${TBB_DOWNLOAD_URL} && \
tar -C ${TBB_INSTALL_DIR} -xf tbb${TBB_VERSION}oss_lin.tgz && \
rm tbb${TBB_VERSION}oss_lin.tgz && \
sed -i "s%SUBSTITUTE_INSTALL_DIR_HERE%${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss%" ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.* && \
echo "source ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64" >> ~/.bashrc
RUN cd okvis && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
mkdir -p /usr/local/lib/cmake && \
mv /usr/local/lib/CMake/* /usr/local/lib/cmake/.
# Pangolin needed for ORB_SLAM2
RUN cd Pangolin && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
cd && \
rm -rf Pangolin
RUN cd ORB_SLAM2 && \
cd Thirdparty/DBoW2 && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../g2o && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../../ && \
cd Vocabulary && \
tar -xf ORBvoc.txt.tar.gz && \
cd .. && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf *
RUN mv okvis/config/config_fpga_p2_euroc.yaml .
RUN mv ORB_SLAM2/Vocabulary/ORBvoc.txt .
# Catkin_make
WORKDIR /root/catkin_ws
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash;. ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64; catkin_make -j3 -DCMAKE_BUILD_TYPE=Release; rm -rf build;'
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
ENV LD_LIBRARY_PATH /opt/tbb2018_20171205oss/lib/intel64/gcc4.7:/root/ORB_SLAM2/lib:/root/ORB_SLAM2/Thirdparty/g2o/lib:/root/ORB_SLAM2/Thirdparty/DBoW2/lib:/root/okvis/build/lib:/root/catkin_ws/devel/lib:/opt/ros/kinetic/lib:$LD_LIBRARY_PATH
ENV PATH /root/catkin_ws/devel/bin:/opt/ros/kinetic/bin:$PATH
ENV ORB_SLAM2_ROOT_DIR /root/ORB_SLAM2
WORKDIR /root
# Build RTAB-Map (using standard g2o, then a version for orbslam2, which uses its own g2o version)
RUN cp -r rtabmap rtabmap_os2 && cp -r rtabmap rtabmap_msckf && cp -r rtabmap rtabmap_loam
RUN cd rtabmap && \
cd build && \
cmake -DWITH_G2O=ON .. && \
make -j3 && \
make install && \
rm -rf * && \
ldconfig
RUN cd rtabmap_os2 && \
cd build && \
cmake -DWITH_G2O=OFF .. && \
make -j3 && \
rm -rf *
# rtabmap is crashing if LOAM and MSCKF dependencies are used at the same time, so split them
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap_loam ; git checkout tools/EurocDataset/main.cpp ;git checkout 0.17.4 ;cd build ;cmake -DWITH_MSCKF_VIO=OFF -DWITH_LOAM=ON -DWITH_G2O=ON -DWITH_FOVIS=OFF -DWITH_DVO=OFF -DWITH_OKVIS=OFF -DWITH_VISO2=OFF .. ;make -j3 ;rm -rf *'
RUN /bin/bash -c '. /root/catkin_ws/devel/setup.bash; cd rtabmap_msckf ; git checkout tools/EurocDataset/main.cpp ;git checkout 0.17.4 ;cd build ;cmake -DWITH_MSCKF_VIO=ON -DWITH_LOAM=OFF -DWITH_G2O=ON -DWITH_FOVIS=OFF -DWITH_DVO=OFF -DWITH_OKVIS=OFF -DWITH_VISO2=OFF .. ;make -j3 ;rm -rf *'
WORKDIR /root
+49
View File
@@ -0,0 +1,49 @@
Docker image used to reproduce all results for KITTI, EuRoC and TUM datasets of the following paper (for MIT Stata Center dataset, see this [page](https://github.com/introlab/rtabmap_ros/blob/master/launch/jfr2018)):
* M. Labbé and F. Michaud, “RTAB-Map as an Open-Source Lidar and Visual SLAM Library for Large-Scale and Long-Term Online Operation,” in Journal of Field Robotics, accepted, 2018. ([pdf](https://introlab.3it.usherbrooke.ca/mediawiki-introlab/images/7/7a/Labbe18JFR_preprint.pdf)) ([Wiley](https://doi.org/10.1002/rob.21831))
Pull image:
```bash
$ docker pull introlab3it/rtabmap:jfr2018
```
or create the image with the `Dockerfile` provided in this directory:
```bash
$ cd rtabmap/docker/jfr2018
$ docker build -t introlab3it/rtabmap:jfr2018 .
```
Make sure to extract datasets in a subfolder called `datasets` relative to scripts in this folder (you can copy the scripts outside rtabmap source directory for convenience). The testing folder tree should look like this:
```bash
datasets/kitti/devkit
datasets/kitti/dataset/sequences/00
datasets/kitti/dataset/sequences/01
datasets/kitti/dataset/sequences/...
datasets/euroc/MH_01_easy
datasets/euroc/V1_01_easy
datasets/euroc/...
datasets/tum/rgbd_dataset_freiburg1_desk
datasets/tum/rgbd_dataset_freiburg3_long_office_household
datasets/tum/...
run_all.sh
run_kitti_datasets.sh
run_euroc_datasets.sh
run_tum_datasets.sh
```
For TUM dataset, use this script [associate.py](https://gist.github.com/matlabbe/484134a2d9da8ad425362c6669824798) to synchronize RGB and depth images before processing. Usage in a TUM dataset: `python associate.py rgb.txt depth.txt`, this will create `rgb_sync` and `depth_sync` folders.
Process all datasets, results will be written to subfolders `results/euroc`, `results/kitti` and `results/tum`:
```bash
./run_all.sh
```
WARNING: processing all datasets with all different odometry approaches can require more than 10 hours to process. You can comment some configurations in [run_all.sh](https://github.com/introlab/rtabmap/blob/master/docker/jfr2018/run_all.sh) if you are interested in just one odometry approach or one dataset. A single sequence can be tested like this too:
```bash
# Processing only sequence 07 of the kitti dataset with F2M odometry approach
./run_kitti_datasets.sh f2m 0 0 07
```
Show all results:
```bash
$ rtabmap-report --scale results
```
+281
View File
@@ -0,0 +1,281 @@
# Image: introlab3it/rtabmap:jfr2018
# Build this image:
# $ cd rtabmap
# $ docker build -t introlab3it/rtabmap:jfr2018 -f docker/jfr2018/latest/Dockerfile .
FROM ubuntu:16.04
WORKDIR /root/
# Install build dependencies
RUN apt-get update && apt-get install -y \
libsqlite3-dev \
libpcl-dev \
git \
cmake \
libproj-dev \
libqt5svg5-dev \
libfreenect-dev \
libopenni2-dev \
libyaml-cpp-dev \
software-properties-common \
libgtk2.0-dev \
pkg-config
# OpenCV (use version <= 3.1.0 for rtabmap 0.16.3 for a solvePnpRansac issue where we have worst ransac performance on newer opencv versions)
RUN git clone https://github.com/opencv/opencv_contrib.git
RUN git clone https://github.com/opencv/opencv.git
RUN cd opencv_contrib && \
git checkout tags/3.1.0 && \
cd && \
cd opencv && \
git checkout tags/3.1.0 && \
mkdir build && \
cd build && \
cmake -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -rf opencv opencv_contrib
# Install ROS to build other odometry approaches (depending on ROS)
# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y --allow-unauthenticated \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# install ros packages
ENV ROS_DISTRO kinetic
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-ros-core=1.3.2-0* \
&& rm -rf /var/lib/apt/lists/*
# install ROS dependencies
RUN apt-get update && apt-get install -y ros-${ROS_DISTRO}-tf ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-eigen-conversions ros-${ROS_DISTRO}-tf-conversions ros-${ROS_DISTRO}-random-numbers ros-${ROS_DISTRO}-image-transport libblas-dev liblapack-dev libsuitesparse-dev libvtk6.2 libyaml-cpp-dev wget libgoogle-glog-dev libatlas-base-dev ros-${ROS_DISTRO}-sophus ros-${ROS_DISTRO}-octomap libglew-dev
# g2o should be built to link on csparse installed system-wide
RUN git clone https://github.com/RainerKuemmerle/g2o.git
RUN cd g2o && \
git checkout 20170730_git && \
mkdir build && \
cd build && \
cmake -DBUILD_LGPL_SHARED_LIBS=ON -DG2O_BUILD_APPS=OFF -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r g2o
# GTSAM
RUN git clone https://bitbucket.org/gtborg/gtsam.git
RUN cd gtsam && \
git checkout 4.0.0-alpha2 && \
mkdir build && \
cd build && \
cmake -DMETIS_SHARED=ON -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r gtsam
# libpointmatcher
RUN git clone https://github.com/ethz-asl/libnabo.git
#commit Apr 25 2018
RUN cd libnabo && \
git checkout 7e378f6765393462357b8b74d8dc8c5554542ae6 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libnabo
RUN git clone https://github.com/ethz-asl/libpointmatcher.git
#commit Jan 19 2018
RUN cd libpointmatcher && \
git checkout 00004bd41e44a1cf8de24ad87e4914760717cbcc && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j3 && \
make install && \
cd && \
rm -r libpointmatcher
# Clone dependencies
RUN mkdir -p catkin_ws/src
WORKDIR /root/catkin_ws/src
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; catkin_init_workspace'
# OPENCV ROS
RUN git clone https://github.com/ros-perception/vision_opencv.git && cd vision_opencv && git checkout kinetic
# make sure cv_bridge is rebuilt before other packages
RUN /bin/bash -c 'cd /root/catkin_ws;. /opt/ros/${ROS_DISTRO}/setup.bash; catkin_make -DCMAKE_BUILD_TYPE=Release; rm -rf build;'
# DVO
RUN git clone https://github.com/tum-vision/dvo_slam.git && cd dvo_slam && git checkout ${ROS_DISTRO}-devel && rm dvo_slam/package.xml && rm dvo_benchmark/package.xml && rm dvo_ros/package.xml
# VISO2
RUN git clone https://github.com/srv/viso2.git && cd viso2 && git checkout ${ROS_DISTRO}
# MSCKF-VIO: using a patched version to be used outside ros and c++14:
RUN git clone https://github.com/borongyuan/msckf_vio.git && cd msckf_vio && git checkout 916c917e5b481741c60732057f0141e8311962c1
# FOVIS
RUN git clone https://github.com/srv/libfovis.git && cd libfovis && git checkout 896acc8425e9fd7c5609153b8bad349ae1abbb50
# LOAM
RUN git clone https://github.com/laboshinl/loam_velodyne.git && cd loam_velodyne && git checkout a4c364a677647f2a35831439032dc5a58378b3fd
# FLOAM
RUN git clone https://github.com/wh200720041/floam.git && cd floam && git checkout 9fdb2ca60a2988c0db515c9c1567100fba8b58d8 && wget https://gist.githubusercontent.com/matlabbe/d8ab56e69146c18afbd1a3b05444c649/raw/f1f37ece5d5787c77f008cb89e9446fc20a40c1f/floam_as_library_support.patch && git apply --ignore-space-change --ignore-whitespace floam_as_library_support.patch
# VINS-Fusion
RUN git clone https://github.com/HKUST-Aerial-Robotics/VINS-Fusion.git && cd VINS-Fusion && git checkout e72b5f7ae7437e8cf481cc0bcbfb5fe91bd3d640 && wget https://gist.githubusercontent.com/matlabbe/795ab37067367dca58bbadd8201d986c/raw/0657cc30fca6b1b61faeef42be9f3428861d2598/vins-fusion_e72b5f7.patch && git apply --ignore-space-change --ignore-whitespace vins-fusion_e72b5f7.patch
# OpenVINS (currently failing because not right ceres version is installed)
# RUN git clone https://github.com/rpng/open_vins.git && cd open_vins && git checkout 83ffb88ad35586d86bddc1e041094f4cd3d400df
WORKDIR /root
# OKVIS
RUN git clone https://github.com/ethz-asl/okvis.git && cd okvis && git checkout 1dce9129f22dd4d21d944788cd9da3a4341586aa && wget https://gist.githubusercontent.com/matlabbe/383be55b5cb682fea217d45ef9a37ef8/raw/bd4f6886eeba3800f0e5171e77abc5dd6dc8bfd9/okvis_1dce912_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace okvis_1dce912_marchnative_disabled.patch
# ORB_SLAM2
RUN git clone https://github.com/stevenlovegrove/Pangolin.git && cd Pangolin && git checkout v0.6
RUN git clone https://github.com/raulmur/ORB_SLAM2.git && cd ORB_SLAM2 && wget https://gist.githubusercontent.com/matlabbe/c10403c5d44af85cc3585c0e1c601a60/raw/48adf04098960d86ddf225f1a8c68af87bfcf56e/orbslam2_f2e6f51_marchnative_disabled.patch && git apply --ignore-space-change --ignore-whitespace orbslam2_f2e6f51_marchnative_disabled.patch
# for dvo, TBB is required (docker related issue)
# Download and install TBB
ENV TBB_RELEASE 2018_U2
ENV TBB_VERSION 2018_20171205
ENV TBB_DOWNLOAD_URL https://github.com/01org/tbb/releases/download/${TBB_RELEASE}/tbb${TBB_VERSION}oss_lin.tgz
ENV TBB_INSTALL_DIR /opt
RUN wget ${TBB_DOWNLOAD_URL} && \
tar -C ${TBB_INSTALL_DIR} -xf tbb${TBB_VERSION}oss_lin.tgz && \
rm tbb${TBB_VERSION}oss_lin.tgz && \
sed -i "s%SUBSTITUTE_INSTALL_DIR_HERE%${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss%" ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.* && \
echo "source ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64" >> ~/.bashrc
RUN cd okvis && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
mkdir -p /usr/local/lib/cmake && \
mv /usr/local/lib/CMake/* /usr/local/lib/cmake/.
# Pangolin needed for ORB_SLAM2
RUN cd Pangolin && \
mkdir build && \
cd build && \
cmake .. && \
make -j3 && \
make install && \
cd && \
rm -rf Pangolin
RUN cd ORB_SLAM2 && \
cd Thirdparty/DBoW2 && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../g2o && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf * && \
cd ../../../ && \
cd Vocabulary && \
tar -xf ORBvoc.txt.tar.gz && \
cd .. && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_BUILD_TYPE=Release && \
make -j3 && \
rm -rf *
RUN mv okvis/config/config_fpga_p2_euroc.yaml .
RUN mv ORB_SLAM2/Vocabulary/ORBvoc.txt .
RUN cp catkin_ws/src/VINS-Fusion/config/euroc/* .
RUN cp catkin_ws/src/VINS-Fusion/config/kitti_odom/* .
# Catkin_make
WORKDIR /root/catkin_ws
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash;. ${TBB_INSTALL_DIR}/tbb${TBB_VERSION}oss/bin/tbbvars.sh intel64; catkin_make -j3 -DCMAKE_BUILD_TYPE=Release; rm -rf build;'
RUN echo "source /root/catkin_ws/devel/setup.bash" >> ~/.bashrc
ENV LD_LIBRARY_PATH /opt/tbb2018_20171205oss/lib/intel64/gcc4.7:/root/ORB_SLAM2/lib:/root/ORB_SLAM2/Thirdparty/g2o/lib:/root/ORB_SLAM2/Thirdparty/DBoW2/lib:/root/catkin_ws/devel/lib:/opt/ros/${ROS_DISTRO}/lib:$LD_LIBRARY_PATH
ENV PATH /root/catkin_ws/devel/bin:/opt/ros/${ROS_DISTRO}/bin:$PATH
ENV ORB_SLAM2_ROOT_DIR /root/ORB_SLAM2
WORKDIR /root
# To make "source" working
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Need cmake >=3.10
RUN apt update && apt install -y wget && apt-get clean && rm -rf /var/lib/apt/lists/ && \
wget -nv https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.tar.gz && \
tar -xzf cmake-3.17.0-Linux-x86_64.tar.gz && \
rm cmake-3.17.0-Linux-x86_64.tar.gz &&\
ln -s ~/cmake-3.17.0-Linux-x86_64/bin/cmake ~/cmake
# Copy current source code
COPY . /root/rtabmap
# Patch for OpenCV 3.1
RUN cd rtabmap && git apply --ignore-space-change --ignore-whitespace docker/jfr2018/rtabmap_opencv310_backward_compatibility.patch
# Build RTAB-Map (using standard g2o, then a version for orbslam2, which uses its own g2o version)
RUN cp -r rtabmap rtabmap_os2 && cp -r rtabmap rtabmap_msckf && cp -r rtabmap rtabmap_loam
RUN source /root/catkin_ws/devel/setup.bash && \
cd rtabmap && \
cd build && \
~/cmake -DWITH_FOVIS=ON -DWITH_VISO2=ON -DWITH_DVO=ON -DWITH_OKVIS=ON -DWITH_VINS=ON -DWITH_OPENVINS=ON -DWITH_OPENGV=OFF .. && \
make -j3 && \
make install && \
rm -rf * && \
ldconfig
# Version with orb_slam2 (system g2o disabled)
RUN source /root/catkin_ws/devel/setup.bash && \
cd rtabmap_os2 && \
cd build && \
~/cmake -DWITH_G2O=OFF -DWITH_ORB_SLAM=ON -DWITH_OPENGV=OFF .. && \
make -j3 && \
rm -rf *
# rtabmap is crashing if LOAM and MSCKF dependencies are used at the same time, so split them
RUN source /root/catkin_ws/devel/setup.bash && \
cd rtabmap_loam && \
cd build && \
~/cmake -DWITH_LOAM=ON -DWITH_FLOAM=ON -DWITH_OPENGV=OFF -DWITH_CERES=ON .. && \
make -j3 && \
rm -rf *
RUN source /root/catkin_ws/devel/setup.bash && \
cd rtabmap_msckf && \
git apply --ignore-space-change --ignore-whitespace docker/jfr2018/rtabmap_msckf_ubuntu_16_compatibility.patch && \
cd build && \
~/cmake -DWITH_MSCKF_VIO=ON -DWITH_OPENGV=OFF .. && \
make -j3 && \
rm -rf *
WORKDIR /root
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c14cb659..2c370200 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -830,6 +830,8 @@ IF(NOT MSVC)
ENDIF()
ENDIF()
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals")
+
####### OSX BUNDLE CMAKE_INSTALL_PREFIX #######
IF(APPLE AND BUILD_AS_BUNDLE)
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f2bfd83..65b03eef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -228,7 +228,7 @@ ENDIF()
set(RTABMAP_QT_VERSION AUTO CACHE STRING "Force a specific Qt version.")
set_property(CACHE RTABMAP_QT_VERSION PROPERTY STRINGS AUTO 4 5 6)
-FIND_PACKAGE(OpenCV REQUIRED QUIET COMPONENTS core calib3d imgproc highgui stitching photo video videoio OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
+FIND_PACKAGE(OpenCV QUIET COMPONENTS core calib3d imgproc highgui stitching photo video videoio OPTIONAL_COMPONENTS aruco xfeatures2d nonfree gpu cudafeatures2d)
IF(WITH_QT)
FIND_PACKAGE(PCL 1.7 REQUIRED QUIET COMPONENTS common io kdtree search surface filters registration sample_consensus segmentation visualization)
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# docker pull introlab3it/rtabmap:jfr2018
mkdir -p results/kitti
./run_kitti_datasets.sh f2m 0 0
./run_kitti_datasets.sh f2f 11 0
./run_kitti_datasets.sh s2m 0 1
./run_kitti_datasets.sh s2s 1 1
./run_kitti_datasets.sh fovis 2 0
./run_kitti_datasets.sh viso2 3 0
./run_kitti_datasets.sh os2 5 0
./run_kitti_datasets.sh loam 7 1
mkdir -p results/tum
./run_tum_datasets.sh f2m 0
./run_tum_datasets.sh f2f 11
./run_tum_datasets.sh fovis 2
./run_tum_datasets.sh dvo 4
./run_tum_datasets.sh os2 5
mkdir -p results/euroc
./run_euroc_datasets.sh f2m 0 0
./run_euroc_datasets.sh f2f 11 0
./run_euroc_datasets.sh os2 5 0
./run_euroc_datasets.sh msckf 88 0
./run_euroc_datasets.sh fovis 2 0
./run_euroc_datasets.sh viso2 3 0
./run_euroc_datasets.sh okvis 66 0
+156
View File
@@ -0,0 +1,156 @@
#!/bin/bash
PWD=$(pwd)
DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
DATASET_ROOT_PATH='./datasets/euroc'
EUROC_RESULTS_PATH='./results/euroc'
mkdir -p $EUROC_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
DATASET_ROOT_PATH='/root/datasets/euroc'
EUROC_RESULTS_PATH='/root/results/euroc'
fi
LIST=( 'V1_01_easy' 'V1_02_medium' 'V1_03_difficult' 'V2_01_easy' 'V2_02_medium' 'V2_03_difficult' 'MH_01_easy' 'MH_02_easy' 'MH_03_medium' 'MH_04_difficult' 'MH_05_difficult')
STRATEGY=0
OUTPUT="test"
DISP=0
if [ $# -eq 4 ]
then
OUTPUT=$1
STRATEGY=$2
DISP=$3
LIST=($4)
elif [ $# -eq 3 ]
then
OUTPUT=$1
STRATEGY=$2
DISP=$3
else
echo "Usage: run_euroc_datasets.sh \"output name\" \"odom strategy: 0=f2m 1=f2f 11=f2f_optflow 2=fovis 3=viso2 4=dvo 5=orbslam2 6=okvis(rect) 66=okvis(raw) 8=msckf_vio(rect) 88=msckf_vio(raw) 9=vins_vio(rect) 99=vins_vio(raw) 10=vins_stereo(rect) 100=vins_stereo(raw)\" \"Disparity: 0 or 1\" [sequence]"
exit
fi
#uncomment for graph gravity optimization
#F2F_params="--Optimizer/GravitySigma 0.01 --g2o/PixelVariance 5"
if [ $STRATEGY -eq 11 ] # F2F optical flow
then
STRATEGY=1
F2F_params="--Vis/CorType 1 --Vis/MinInliers 20 --RGBD/OptimizeMaxError 0"
fi
if [ $STRATEGY -eq 1 ] # F2F
then
F2F_params="--Odom/KeyFrameThr 0.6 $F2F_params"
fi
if [ $DISP -eq 1 ]
then
F2F_params="--disp --StereoBM/NumDisparities 32 --StereoBM/UniquenessRatio 5 $F2F_params"
else
F2F_params="--exposure_comp $F2F_params"
fi
if [ $STRATEGY -eq 66 ] # okvis raw images
then
STRATEGY=6
F2F_params="--raw --Odom/GuessMotion false --OdomOKVIS/ConfigPath ./config_fpga_p2_euroc.yaml $F2F_params"
fi
if [ $STRATEGY -eq 6 ] # okvis
then
F2F_params="--Odom/GuessMotion false --OdomOKVIS/ConfigPath ./config_fpga_p2_euroc.yaml $F2F_params"
fi
if [ $STRATEGY -eq 88 ] # msckf_vio raw images
then
STRATEGY=8
F2F_params="--raw --Odom/GuessMotion false $F2F_params"
fi
if [ $STRATEGY -eq 8 ] # msckf_vio
then
F2F_params="--Odom/GuessMotion false $F2F_params"
fi
if [ $STRATEGY -eq 99 ] # vins raw images
then
STRATEGY=9
F2F_params="--raw --Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_imu_config.yaml $F2F_params"
fi
if [ $STRATEGY -eq 9 ] # vins
then
F2F_params="--Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_imu_config.yaml $F2F_params"
fi
if [ $STRATEGY -eq 100 ] # vins (stereo-only) raw images
then
STRATEGY=9
F2F_params="--raw --Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_config.yaml $F2F_params"
fi
if [ $STRATEGY -eq 10 ] # vins (stereo-only)
then
F2F_params="--Odom/GuessMotion false --OdomVINS/ConfigPath ./euroc_stereo_config.yaml $F2F_params"
fi
RTABMAP_EUROC_TOOL="rtabmap-euroc_dataset"
if [ $DOCKER -eq 1 ]
then
# Select rtabmap built with os2 support or not
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then
TOOL_PREFIX="/root/rtabmap_os2/bin"
elif [ $STRATEGY -eq 8 ]
then
TOOL_PREFIX="/root/rtabmap_msckf/bin"
fi
RTABMAP_EUROC_TOOL="docker run -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset"
if [ $STRATEGY -eq 6 ]
then
xhost +
RTABMAP_EUROC_TOOL="docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD/datasets/euroc:$DATASET_ROOT_PATH -v $PWD/results/euroc:$EUROC_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-euroc_dataset"
fi
fi
echo $RTABMAP_EUROC_TOOL
for d in "${LIST[@]}"
do
V203_params=""
if [ "$d" == "V2_03_difficult" ]
then
if [[ $STRATEGY -eq 0 || $STRATEGY -eq 1 ]]
then
V203_params="--Vis/MinInliers 10 --Vis/PnPReprojError 3"
fi
fi
taskset 0x1 $RTABMAP_EUROC_TOOL \
--Rtabmap/PublishRAMUsage true\
--RGBD/LinearUpdate 0\
--RGBD/AngularUpdate 0\
--RGBD/ProximityBySpace false\
--Rtabmap/DetectionRate 2\
--Kp/FlannRebalancingFactor 1.0\
--GFTT/MinDistance 3\
--Odom/Strategy $STRATEGY\
--Mem/STMSize 30\
--Mem/UseOdomFeatures false \
--Mem/BinDataKept false \
--Rtabmap/CreateIntermediateNodes false\
--Vis/CorNNDR 0.6 \
--Vis/CorGuessWinSize 20 \
$V203_params\
$F2F_params\
--OdomORBSLAM2/VocPath /root/ORBvoc.txt\
--OdomORBSLAM2/ThDepth 35\
--OdomORBSLAM2/MaxFeatures 1200\
--output "$EUROC_RESULTS_PATH/$d"\
--output_name $OUTPUT\
--quiet\
$DATASET_ROOT_PATH/$d
done
# For V2_03_difficult: --Vis/MinInliers 10 --disp StereoBM/NumDisparities 32 --StereoBM/UniquenessRatio 5 --Vis/PnPReprojError 3
+144
View File
@@ -0,0 +1,144 @@
#!/bin/bash
PWD=$(pwd)
DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
KITTI_ROOT_PATH='./datasets/kitti'
KITTI_RESULTS_PATH='./results/kitti'
mkdir -p $KITTI_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
KITTI_ROOT_PATH='/root/datasets/kitti'
KITTI_RESULTS_PATH='/root/results/kitti'
fi
LIST=('00' '01' '02' '03' '04' '05' '06' '07' '08' '09' '10')
#LIST=('11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21')
STRATEGY=0
REG=0
OUTPUT="test"
if [ $# -eq 4 ]
then
OUTPUT=$1
STRATEGY=$2
REG=$3
LIST=($4)
elif [ $# -eq 3 ]
then
OUTPUT=$1
STRATEGY=$2
REG=$3
else
echo "Usage: run_kitti_datasets.sh \"output name\" \"odom strategy: 0=f2m 1=f2f 11=f2f_optflow 2=fovis 3=viso2 4=dvo 5=orbslam2 7=LOAM 9=VINS\" \"reg strategy: 0=vis 1=icp-point2point 11=icp-point2plane\" [sequence]"
exit
fi
F2F_params=""
if [ $STRATEGY -eq 11 ]
then
STRATEGY=1
F2F_params="--Vis/CorType 1"
fi
if [ $STRATEGY -eq 1 ]
then
F2F_params="--Odom/KeyFrameThr 0.6 $F2F_params"
fi
if [ $STRATEGY -eq 3 ]
then
F2F_params=" $F2F_params"
fi
if [ $STRATEGY -eq 9 ]
then
F2F_params="--OdomVINS/ConfigPath ./kitti_config04-12.yaml $F2F_params"
fi
SCAN=""
if [[ $REG -eq 1 || $REG -eq 11 ]]
then
if [ $REG -eq 11 ]
then
REG=1
if [ $STRATEGY -eq 7 ]
then
SCAN="--Mem/LaserScanVoxelSize 0.5 --Mem/LaserScanNormalK 10 --scan_voxel 0.0"
else
SCAN="--scan_k 10 --scan_voxel 0.5"
fi
SCAN="--Icp/PointToPlane true --Icp/PointToPlaneK 10 --Icp/PointToPlaneRadius 0 --Icp/Iterations 5 --Odom/ScanKeyFrameThr 0.6 $SCAN"
else
if [ $STRATEGY -eq 7 ]
then
SCAN="--Mem/LaserScanVoxelSize 0.5 --scan_voxel 0.0"
else
SCAN="--scan_voxel 0.5"
fi
SCAN="--Icp/PointToPlane false --Icp/Iterations 10 --Odom/ScanKeyFrameThr 0.8 $SCAN"
fi
SCAN="--scan --Reg/Strategy $REG --OdomF2M/ScanMaxSize 10000 --OdomF2M/ScanSubtractRadius 0.5 --Odom/LOAMSensor 2 --Icp/MaxTranslation 2 --Icp/Epsilon 0.0001 --Icp/MaxCorrespondenceDistance 1.5 --Icp/CorrespondenceRatio 0.01 --Icp/PM true --Icp/PMOutlierRatio 0.7 --Icp/PMMatcherKnn 3 --Icp/PMMatcherEpsilon 1 --Icp/ReciprocalCorrespondences false $SCAN"
fi
RTABMAP_KITTI_TOOL="rtabmap-kitti_dataset"
if [ $DOCKER -eq 1 ]
then
# Select rtabmap built with os2 support or not
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then
TOOL_PREFIX="/root/rtabmap_os2/bin"
elif [ $STRATEGY -eq 7 ]
then
TOOL_PREFIX="/root/rtabmap_loam/bin"
fi
RTABMAP_KITTI_TOOL="docker run -v $PWD/datasets/kitti:$KITTI_ROOT_PATH -v $PWD/results/kitti:$KITTI_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-kitti_dataset"
fi
echo $RTABMAP_KITTI_TOOL
for d in "${LIST[@]}"
do
taskset 0x1 $RTABMAP_KITTI_TOOL \
--Rtabmap/PublishRAMUsage true\
--Vis/MaxFeatures 1500\
--RGBD/LinearUpdate 0\
--RGBD/AngularUpdate 0\
--RGBD/ProximityBySpace false\
--Rtabmap/DetectionRate 2\
--Kp/MaxFeatures 750\
--Kp/FlannRebalancingFactor 1.0\
--GFTT/QualityLevel 0.01\
--GFTT/MinDistance 7\
--OdomF2M/MaxSize 3000\
--Rtabmap/CreateIntermediateNodes true\
--Odom/Strategy $STRATEGY\
$F2F_params \
--OdomORBSLAM2/VocPath /root/ORBvoc.txt\
--OdomORBSLAM2/ThDepth 40\
--OdomORBSLAM2/Fps 10\
--OdomORBSLAM2/MaxFeatures 2000\
--OdomViso2/MatchNmsN 7\
--OdomViso2/MatchRadius 300\
--FAST/Threshold 12\
--Mem/STMSize 30\
--Mem/UseOdomFeatures false \
--Mem/BinDataKept false \
--Vis/CorNNDR 0.6 \
--Vis/CorGuessWinSize 20 \
$SCAN \
--gt $KITTI_ROOT_PATH"/devkit/cpp/data/odometry/poses/$d.txt"\
--output "$KITTI_RESULTS_PATH/$d"\
--output_name $OUTPUT\
--quiet\
$KITTI_ROOT_PATH/dataset/sequences/$d
done
# ORB_SLAM2:
# 0-2: --OdomORBSLAM2/ThDepth 35
# 3-12: --OdomORBSLAM2/ThDepth 40 (default)
# 0-3: --FAST/Threshold 20 (default)
# 4-12: --FAST/Threshold 12 --OdomORBSLAM2/ThDepth 40
# --OdomORBSLAM2/MaxFeatures 2000
#
+101
View File
@@ -0,0 +1,101 @@
#!/bin/bash
PWD=$(pwd)
DOCKER=1 # set to 0 to use host rtabmap tool and relative datasets to this script
RGBD_ROOT_PATH='./datasets/tum'
RGBD_RESULTS_PATH='./results/tum'
mkdir -p $RGBD_RESULTS_PATH
if [ $DOCKER -eq 1 ]
then
RGBD_ROOT_PATH='/root/datasets/tum'
RGBD_RESULTS_PATH='/root/results/tum'
fi
LIST=( 'rgbd_dataset_freiburg1_desk' 'rgbd_dataset_freiburg1_desk2' 'rgbd_dataset_freiburg1_room' 'rgbd_dataset_freiburg2_desk' 'rgbd_dataset_freiburg2_xyz' 'rgbd_dataset_freiburg3_long_office_household' 'rgbd_dataset_freiburg3_nostructure_texture_near_withloop_validation')
# more: 'rgbd_dataset_freiburg1_360' 'rgbd_dataset_freiburg1_plant' 'rgbd_dataset_freiburg1_rpy' 'rgbd_dataset_freiburg1_teddy' 'rgbd_dataset_freiburg2_360_hemisphere' 'rgbd_dataset_freiburg2_large_no_loop' 'rgbd_dataset_freiburg2_large_with_loop' 'rgbd_dataset_freiburg1_floor'
# Got Lost: 'rgbd_dataset_freiburg1_floor' (at 11 seconds end), 'rgbd_dataset_freiburg3_teddy'
STRATEGY=0
OUTPUT="test"
if [ $# -eq 3 ]
then
OUTPUT=$1
STRATEGY=$2
LIST=($3)
elif [ $# -eq 2 ]
then
OUTPUT=$1
STRATEGY=$2
else
echo "Usage: run_tum_datasets.sh \"output name\" \"odom strategy: 0=f2m 1=f2f 11=f2f_optflow 2=fovis 3=viso2 4=dvo 5=orbslam2\" [sequence]"
exit
fi
F2F_params=""
if [ $STRATEGY -eq 11 ]
then
STRATEGY=1
F2F_params="--Vis/CorType 1"
fi
if [ $STRATEGY -eq 1 ]
then
F2F_params="--Odom/KeyFrameThr 0.6 $F2F_params"
fi
if [[ $STRATEGY -eq 2 || $STRATEGY -eq 4 ]]
then
F2F_params="--RGBD/OptimizeMaxError 0 $F2F_params"
fi
RTABMAP_RGBD_TOOL="rtabmap-rgbd_dataset"
if [ $DOCKER -eq 1 ]
then
# Select rtabmap built with os2 support or not
TOOL_PREFIX="/usr/local/bin"
if [ $STRATEGY -eq 5 ]
then
TOOL_PREFIX="/root/rtabmap_os2/bin"
fi
RTABMAP_RGBD_TOOL="docker run -v $PWD/datasets/tum:$RGBD_ROOT_PATH -v $PWD/results/tum:$RGBD_RESULTS_PATH -i -t --rm introlab3it/rtabmap:jfr2018 $TOOL_PREFIX/rtabmap-rgbd_dataset"
fi
echo $RTABMAP_RGBD_TOOL
# no --disp with 01?
for d in "${LIST[@]}"
do
DETECTION_RATE=2
if [[ "$d" == "rgbd_dataset_freiburg1_desk" || "$d" == "rgbd_dataset_freiburg1_desk2" ]]
then
DETECTION_RATE=4
fi
taskset 0x1 $RTABMAP_RGBD_TOOL \
--Rtabmap/PublishRAMUsage true\
--RGBD/LinearUpdate 0\
--RGBD/AngularUpdate 0\
--Rtabmap/DetectionRate $DETECTION_RATE\
--Kp/FlannRebalancingFactor 1.0\
--GFTT/MinDistance 3\
--Odom/Strategy $STRATEGY\
--Mem/STMSize 30\
--Mem/UseOdomFeatures false \
--Mem/BinDataKept true \
--Rtabmap/CreateIntermediateNodes false\
--Vis/CorNNDR 0.6 \
--Vis/CorGuessWinSize 20 \
$F2F_params\
--OdomORBSLAM2/VocPath /root/ORBvoc.txt\
--OdomFovis/MinFeaturesForEstimate 10\
--output "$RGBD_RESULTS_PATH/$d"\
--output_name $OUTPUT\
--quiet\
$RGBD_ROOT_PATH/$d
done
#--Odom/Strategy 1\
#--Vis/CorType 1\
+87
View File
@@ -0,0 +1,87 @@
# humble or jazzy
ARG ROS_DISTRO=humble
FROM osrf/ros:${ROS_DISTRO}-desktop
# Install build dependencies
RUN apt-get update && \
apt-get install -y git software-properties-common ros-${ROS_DISTRO}-rtabmap-ros libqt6* qt6* qml6* && \
apt-get remove -y ros-${ROS_DISTRO}-rtabmap* ros-${ROS_DISTRO}-gtsam ros-${ROS_DISTRO}-libg2o libpcl* libqt5* qt5* libvtk* libopencv* && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Build latest VTK with Qt6
RUN git clone https://github.com/Kitware/VTK.git && \
cd VTK && \
mkdir build && \
cd build && \
cmake -DVTK_GROUP_ENABLE_Qt=YES .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf VTK
# Build latest PCL with latest VTK
# Make sure all libraries depending on Eigen are built with same CXX standard (17)
RUN git clone https://github.com/PointCloudLibrary/pcl.git && \
cd pcl && \
mkdir build && \
cd build && \
cmake -DCMAKE_CXX_STANDARD=17 -DBUILD_tools=OFF -DPCL_ENABLE_AVX=OFF -DPCL_ENABLE_MARCHNATIVE=OFF -DPCL_ENABLE_SSE=OFF .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf pcl
# Build latest OpenCV
RUN git clone https://github.com/opencv/opencv.git && \
git clone https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
mkdir build && \
cd build && \
cmake -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
# Build latest gtsam
RUN git clone https://github.com/borglab/gtsam.git && \
cd gtsam && \
mkdir build && \
cd build && \
cmake -DCMAKE_CXX_STANDARD=17 -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_BUILD_UNSTABLE=OFF -DGTSAM_INSTALL_CPPUNILITE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON .. && \
cmake --build . --config Release --target install && \
cd ../.. && \
rm -rf gtsam
# Build latest g2o
RUN git clone https://github.com/RainerKuemmerle/g2o.git && \
cd g2o && \
mkdir build && \
cd build && \
cmake -DCMAKE_CXX_STANDARD=17 -DBUILD_WITH_MARCH_NATIVE=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF .. && \
cmake --build . --config Release --target install && \
cd ../.. && \
rm -rf g2o
RUN mkdir -p /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake .. && \
make -j$(nproc) && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+20
View File
@@ -0,0 +1,20 @@
# Image: introlab3it/rtabmap:noble-kilted
FROM introlab3it/rtabmap:noble-kilted-deps
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_OPENGV=ON .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+132
View File
@@ -0,0 +1,132 @@
# Image: introlab3it/rtabmap:noble-kilted-deps
FROM ubuntu:24.04
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
ENV DEBIAN_FRONTEND=noninteractive
# Install ROS2
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe && \
apt update && \
apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/
# Install build dependencies
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y \
git \
wget \
libtbb-dev \
libproj-dev \
libpcl-dev \
liboctomap-dev \
libfreenect-dev \
ros-kilted-ros-base \
ros-dev-tools \
ros-kilted-cv-bridge \
ros-kilted-image-geometry \
ros-kilted-laser-geometry \
ros-kilted-pcl-conversions \
ros-kilted-rviz-common \
ros-kilted-rviz-rendering \
ros-kilted-rviz-default-plugins \
ros-kilted-pcl-ros \
ros-kilted-imu-filter-madgwick \
ros-kilted-velodyne \
ros-kilted-image-transport \
ros-kilted-octomap-msgs \
ros-kilted-libg2o \
ros-kilted-libpointmatcher \
ros-kilted-qt-gui-cpp \
ros-kilted-diagnostic-updater && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# GTSAM (we cannot use ros-kilted-gtsam on Noble because it is linked to a different internal Eigen version than system one)
RUN git clone https://github.com/borglab/gtsam.git && \
cd gtsam && \
git checkout 4.2.0 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON .. && \
make -j4 && \
make install && \
cd && \
rm -r gtsam
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install -y libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r zed-open-capture; fi
# OpenCV with all modules (same version than distro version to avoid conflicts with cv_bridge ros package)
RUN git clone --branch 4.6.0 https://github.com/opencv/opencv.git && \
git clone --branch 4.6.0 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
sed -i '/#include <libavformat\/avformat.h>/i #include <libavcodec/version.h>' modules/videoio/src/ffmpeg_codecs.hpp && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TBB=ON -DWITH_ADE=OFF -DWITH_OPENMP=ON -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -r opengv
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo -e '#!/bin/bash\nset -e\n\n# setup ros2 environment\nsource "/opt/ros/kilted/setup.bash" --\nexec "$@"' > /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
# ros2 seems not sourcing by default its multi-arch folders
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/kilted/lib/x86_64-linux-gnu:/opt/ros/kilted/lib/aarch64-linux-gnu
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
+20
View File
@@ -0,0 +1,20 @@
# Image: introlab3it/rtabmap:noble
FROM introlab3it/rtabmap:noble-deps
# Will be used to read/store databases on host
RUN mkdir -p /root/Documents/RTAB-Map && chmod 777 /root/Documents/RTAB-Map
# Copy current source code
COPY . /root/rtabmap
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake -DWITH_OPENGV=ON .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+206
View File
@@ -0,0 +1,206 @@
# Image: introlab3it/rtabmap:android-noble-deps
FROM ubuntu:24.04
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
RUN apt-get update && apt-get install -y \
git unzip wget ant cmake \
g++ lib32stdc++6 lib32z1 \
software-properties-common \
freeglut3-dev \
openjdk-8-jdk openjdk-8-jre \
curl
ENV ANDROID_HOME=/opt/android-sdk
ENV PATH=$PATH:/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-sdk/ndk/21.4.7075529
ENV ANDROID_NDK=/opt/android-sdk/ndk/21.4.7075529
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
WORKDIR /root/
# Setup android sdk
RUN wget -nv https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && \
unzip -qq commandlinetools-linux-7583922_latest.zip && \
rm commandlinetools-linux-7583922_latest.zip && \
mkdir $ANDROID_HOME && \
mkdir $ANDROID_HOME/cmdline-tools && \
mv cmdline-tools $ANDROID_HOME/cmdline-tools/latest
# We should use build-tools <=30 to avoid dx missing error
RUN echo y | sdkmanager --install "platform-tools" "platforms;android-23" "platforms;android-24" "platforms;android-26" "platforms;android-30" "build-tools;30.0.3" "ndk;21.4.7075529"
# we need <=r25 tools to use "android" command (now deprecated)
RUN wget -nv http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip && \
unzip -qq tools_r25.2.5-linux.zip && \
mv tools $ANDROID_HOME/. && \
rm tools_r25.2.5-linux.zip
##############
# Dependencies (took from docker/bionic/android/deps.bash)
##############
# Install directory for all dependencies
RUN mkdir -p /opt/android/arm64-v8a
# Boost
RUN echo "Install boost..." && \
wget -nv https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz && \
tar -xzf boost_1_59_0.tar.gz && \
cd boost_1_59_0 && \
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/1733253195bc4d4d9b7f9eda1e60628dc1e51429/BoostConfig.cmake.in && \
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/1733253195bc4d4d9b7f9eda1e60628dc1e51429/CMakeLists.txt && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" .. && \
make -j4 && \
make install && \
cd /root && \
rm -r boost_1_59_0.tar.gz boost_1_59_0
# eigen
RUN echo "Install eigen..." && \
curl -L https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz -o 3.3.9.tar.gz && \
tar -xzf 3.3.9.tar.gz && \
cd eigen-3.3.9 && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" .. && \
make -j4 && \
make install && \
cd /root && \
rm -r 3.3.9.tar.gz eigen-3.3.9
# FLANN
RUN echo "Install flann..." && \
git clone -b 1.8.4 https://github.com/mariusmuja/flann.git && \
cd flann && \
wget -nv https://gist.githubusercontent.com/matlabbe/cacff9f8271d0c42acd622939a26cab4/raw/85baf4927b32844ebd7f8eccce421bde181cd190/flann_1_8_4_android_fix.patch && \
git apply flann_1_8_4_android_fix.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DBUILD_PYTHON_BINDINGS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" .. && \
make -j4 && \
make install && \
cd /root && \
rm -rf flann
# GTSAM
RUN echo "Install gtsam..." && \
git clone https://bitbucket.org/gtborg/gtsam.git && \
cd gtsam && \
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5 && \
wget -nv https://gist.github.com/matlabbe/726b490c658afd3293f4b3f2f501b863/raw/df09fc8e238a495d66b062d92dc1c1fb20a581e8/gtsam_GKlib_android_fix.patch && \
git apply gtsam_GKlib_android_fix.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON .. && \
make -j4 && \
make install && \
cd /root && \
rm -rf gtsam
# g2o
RUN echo "Install g2o..." && \
git clone https://github.com/RainerKuemmerle/g2o.git && \
cd g2o && \
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DG2O_USE_OPENGL=OFF .. && \
make -j4 && \
make install && \
cd /root && \
rm -rf g2o
# VTK
RUN echo "Install VTK..." && \
git clone https://github.com/Kitware/VTK.git && \
cd VTK && \
git checkout tags/v8.2.0 && \
wget https://gist.github.com/matlabbe/e217259fb8ece9ee6daf5a8f70e896a0/raw/2214b503a537d6431d764526b5b780f07d6f168d/vtk_8_2_0_android_r21_fix.patch && \
git apply vtk_8_2_0_android_r21_fix.patch && \
mkdir build && \
cd build && \
cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_ANDROID_BUILD=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DANDROID_ARCH_ABI=arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" .. && \
make -j4 && \
cp -r CMakeExternals/Install/vtk-android/* /opt/android/arm64-v8a/. && \
cd /root && \
rm -rf VTK
# PCL
RUN echo "Install pcl..." && \
git clone https://github.com/PointCloudLibrary/pcl.git && \
cd pcl && \
git checkout tags/pcl-1.8.0 && \
wget https://gist.github.com/matlabbe/41812e50e459b2f27b331a2343569e5d/raw/b2fc0c4d1cfffb3a9f2811abae782e317c539bfb/pcl_1_8_0_vtk_android_support.patch && \
git apply pcl_1_8_0_vtk_android_support.patch && \
mkdir build && \
cd build && \
# do it 2 times because there is a cmake error on the first time and not the second time!?
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_tools=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF .. || true && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_tools=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF .. && \
make -j4 && \
make install && \
cd /root && \
rm -rf pcl
# make sure opencv is using the shared version of zlib
# see https://github.com/android/ndk/issues/1179
RUN mv $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a $ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libz.a.back
# OpenCV
RUN echo "Install OpenCV..." && \
git clone https://github.com/opencv/opencv_contrib.git && \
git clone https://github.com/opencv/opencv.git && \
cd opencv_contrib && \
git checkout tags/4.5.5 && \
cd /root && \
cd opencv && \
git checkout tags/4.5.5 && \
mkdir build && \
cd build && \
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=23 -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/android/arm64-v8a -DCMAKE_FIND_ROOT_PATH="/opt/android/arm64-v8a/bin;/opt/android/arm64-v8a;/opt/android/arm64-v8a/share" -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DBUILD_opencv_structured_light=OFF -DBUILD_ANDROID_PROJECTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DBUILD_ANDROID_EXAMPLES=OFF -DWITH_PROTOBUF=OFF -DBUILD_opencv_stereo=OFF -DBUILD_JAVA=OFF -DWITH_QUIRC=OFF -DBUILD_opencv_js_bindings_generator=OFF -DBUILD_opencv_objc_bindings_generator=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_xobjdetect=OFF .. && \
make -j4 && \
make install && \
cd /root && \
rm -rf opencv opencv_contrib
RUN echo "Strip libraries..." && \
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip -g -S -d --strip-debug --verbose /opt/android/arm64-v8a/lib/*.a && \
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip -g -S -d --strip-debug --verbose /opt/android/arm64-v8a/sdk/native/staticlibs/arm64-v8a/*.a
RUN mkdir /opt/android/lib
# tango
RUN wget 'https://docs.google.com/uc?authuser=0&id=12rHHkYM5k-UnQn-xGXs9JqYWhSXrgJr3&export=download' -O TangoSDK_Ikariotikos_C.zip && \
unzip -qq TangoSDK_Ikariotikos_C.zip && \
rm TangoSDK_Ikariotikos_C.zip && \
cp -r lib_tango_client_api/include/* /opt/android/arm64-v8a/include/. && \
cp -r lib_tango_client_api/lib/arm64-v8a/* /opt/android/arm64-v8a/lib/. && \
rm -r lib_tango_client_api && \
wget 'https://docs.google.com/uc?authuser=0&id=1AqVuEVu5284X6OgrGWu12VTrx4pY99Jb&export=download' -O TangoSupport_Ikariotikos_C.zip && \
unzip -qq TangoSupport_Ikariotikos_C.zip && \
rm TangoSupport_Ikariotikos_C.zip && \
cp -r lib_tango_support_api/include/* /opt/android/arm64-v8a/include/. && \
cp -r lib_tango_support_api/lib/arm64-v8a/* /opt/android/arm64-v8a/lib/. && \
rm -r lib_tango_support_api && \
wget 'https://docs.google.com/uc?authuser=0&id=1s5iPJ7xiridj9Jj--gCy2XiQFniheVm6&export=download' -O TangoSDK_Ikariotikos_Java.jar && \
mv TangoSDK_Ikariotikos_Java.jar /opt/android/lib/
# ARCore
RUN wget 'https://docs.google.com/uc?authuser=0&id=1VsibeqRYpS5pjmrG-vYTXyiPg8kbIfVN&export=download' -O arcore.zip && \
unzip -qq arcore.zip && \
rm arcore.zip && \
cp -r arcore1_18/include/* /opt/android/arm64-v8a/include/. && \
cp -r arcore1_18/arm64-v8a/* /opt/android/arm64-v8a/lib/. && \
cp arcore1_18/*.jar /opt/android/lib/ && \
rm -r arcore1_18
# AREngine
RUN wget 'https://docs.google.com/uc?authuser=0&id=1rdaD2Z1QBv-SUeUy0oBmg3C2odfxTHgR&export=download' -O arengine.zip && \
unzip -qq arengine.zip && \
rm arengine.zip && \
cp -r arengine/include/* /opt/android/arm64-v8a/include/. && \
cp -r arengine/arm64-v8a/* /opt/android/arm64-v8a/lib/. && \
cp arengine/*.jar /opt/android/lib/ && \
rm -r arengine
@@ -0,0 +1,13 @@
# Image: introlab3it/rtabmap:androidXX
FROM introlab3it/rtabmap:android-noble-deps
ARG API_VERSION=23
# Copy current source code
COPY . /root/rtabmap-tango
WORKDIR /root/rtabmap-tango
RUN /bin/bash -c "./docker/noble/android/rtabmap_apiXX/rtabmap.bash /opt/android $API_VERSION"
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
set -e
if [ $# -ne 2 ]; then
echo "rtabmap.bash android_install_prefix api_level (23 for tango, 24 for arengine) # Example: build.bash /opt/android 24"
exit 1
fi
prefix=$1
api=$2
# copy required jars
cp /opt/android/lib/*.jar app/android/libs/.
# resource tool
cd build
cmake -DANDROID_PREBUILD=ON ..
make
# rtabmap
mkdir arm64-v8a
cd arm64-v8a
cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DANDROID_NDK=$ANDROID_NDK -DANDROID_NATIVE_API_LEVEL=$api -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a -DCMAKE_FIND_ROOT_PATH="$prefix/arm64-v8a/bin;$prefix/arm64-v8a;$prefix/arm64-v8a/share" -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF -DOpenCV_DIR=$prefix/arm64-v8a/sdk/native/jni ../..
make
make clean
+131
View File
@@ -0,0 +1,131 @@
# Image: introlab3it/rtabmap:noble-deps
FROM ubuntu:24.04
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
RUN echo "I am building for $TARGETPLATFORM"
ENV DEBIAN_FRONTEND=noninteractive
# Install ROS2
RUN apt update && \
apt install software-properties-common -y && \
add-apt-repository universe && \
apt update && \
apt install curl -y && \
curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \
apt-get clean && rm -rf /var/lib/apt/lists/
# Install build dependencies
RUN apt-get update && \
apt upgrade -y && \
apt-get install -y \
git \
wget \
libtbb-dev \
libproj-dev \
libpcl-dev \
liboctomap-dev \
libfreenect-dev \
ros-jazzy-ros-base \
ros-dev-tools \
ros-jazzy-cv-bridge \
ros-jazzy-image-geometry \
ros-jazzy-laser-geometry \
ros-jazzy-pcl-conversions \
ros-jazzy-rviz-common \
ros-jazzy-rviz-rendering \
ros-jazzy-rviz-default-plugins \
ros-jazzy-pcl-ros \
ros-jazzy-imu-filter-madgwick \
ros-jazzy-velodyne \
ros-jazzy-image-transport \
ros-jazzy-octomap-msgs \
ros-jazzy-libg2o \
ros-jazzy-libpointmatcher \
ros-jazzy-qt-gui-cpp \
ros-jazzy-diagnostic-updater && \
apt-get clean && rm -rf /var/lib/apt/lists/
WORKDIR /root/
# GTSAM (we cannot use ros-jazzy-gtsam on Noble because it is linked to a different internal Eigen version than system one)
RUN git clone https://github.com/borglab/gtsam.git && \
cd gtsam && \
git checkout 4.2.0 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON .. && \
make -j4 && \
make install && \
cd && \
rm -r gtsam
# libfreenect2
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing libfreenect2..." && \
apt-get update && apt-get install -y mesa-utils xserver-xorg-video-all libusb-1.0-0-dev libturbojpeg0-dev libglfw3-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/OpenKinect/libfreenect2 && \
cd libfreenect2 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r libfreenect2; fi
# zed open capture
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then echo "Installing zed-open-capture..." && \
apt-get update && apt install -y libusb-1.0-0-dev libhidapi-libusb0 libhidapi-dev wget && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
git clone https://github.com/stereolabs/zed-open-capture.git && \
cd zed-open-capture && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j4 && \
make install && \
cd && \
rm -r zed-open-capture; fi
# OpenCV with all modules (same version than distro version to avoid conflicts with cv_bridge ros package)
RUN git clone --branch 4.6.0 https://github.com/opencv/opencv.git && \
git clone --branch 4.6.0 https://github.com/opencv/opencv_contrib.git && \
cd opencv && \
sed -i '/#include <libavformat\/avformat.h>/i #include <libavcodec/version.h>' modules/videoio/src/ffmpeg_codecs.hpp && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DWITH_TBB=ON -DWITH_ADE=OFF -DWITH_OPENMP=ON -DBUILD_opencv_python3=OFF -DBUILD_opencv_python_bindings_generator=OFF -DBUILD_opencv_python_tests=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF -DOPENCV_ENABLE_NONFREE=ON -DOPENCV_EXTRA_MODULES_PATH=/root/opencv_contrib/modules .. && \
make -j4 && \
make install && \
cd ../.. && \
rm -rf opencv opencv_contrib
RUN git clone https://github.com/laurentkneip/opengv.git && \
cd opengv && \
git checkout 91f4b19c73450833a40e463ad3648aae80b3a7f3 && \
wget https://gist.githubusercontent.com/matlabbe/a412cf7c4627253874f81a00745a7fbb/raw/accc3acf465d1ffd0304a46b17741f62d4d354ef/opengv_disable_march_native.patch && \
git apply opengv_disable_march_native.patch && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF .. && \
make -j4 && \
make install && \
cd && \
rm -r opengv
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN echo -e '#!/bin/bash\nset -e\n\n# setup ros2 environment\nsource "/opt/ros/jazzy/setup.bash" --\nexec "$@"' > /ros_entrypoint.sh
RUN chmod +x /ros_entrypoint.sh
ENTRYPOINT [ "/ros_entrypoint.sh" ]
# ros2 seems not sourcing by default its multi-arch folders
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/ros/jazzy/lib/x86_64-linux-gnu:/opt/ros/jazzy/lib/aarch64-linux-gnu
# for jetson (https://github.com/introlab/rtabmap/issues/776)
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/tegra
+27
View File
@@ -0,0 +1,27 @@
# Image: introlab3it/rtabmap:trusty
FROM ros:indigo-perception
# Install/build dependencies
RUN apt-get update && \
apt-get install -y ros-indigo-rtabmap-ros && \
apt-get remove -y ros-indigo-rtabmap && \
rm -rf /var/lib/apt/lists/
WORKDIR /root/
# Copy current source code
COPY . /root/rtabmap
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake .. && \
make && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+63
View File
@@ -0,0 +1,63 @@
# Image: introlab3it/rtabmap:xenial
FROM ros:kinetic-perception
# Install/build dependencies
RUN apt-get update && \
apt-get install -y ros-kinetic-rtabmap-ros && \
apt-get remove -y ros-kinetic-rtabmap && \
rm -rf /var/lib/apt/lists/
WORKDIR /root/
# GTSAM
RUN git clone https://bitbucket.org/gtborg/gtsam.git
RUN cd gtsam && \
git checkout 4.0.0-alpha2 && \
mkdir build && \
cd build && \
cmake -DMETIS_SHARED=ON -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_USE_SYSTEM_EIGEN=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r gtsam
# libpointmatcher
RUN git clone https://github.com/ethz-asl/libnabo.git
#commit Apr 25 2018
RUN cd libnabo && \
git checkout 7e378f6765393462357b8b74d8dc8c5554542ae6 && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r libnabo
RUN git clone https://github.com/ethz-asl/libpointmatcher.git
#commit Jan 19 2018
RUN cd libpointmatcher && \
git checkout 00004bd41e44a1cf8de24ad87e4914760717cbcc && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make -j$(nproc) && \
make install && \
cd && \
rm -r libpointmatcher
# Copy current source code
COPY . /root/rtabmap
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Build RTAB-Map project
RUN source /ros_entrypoint.sh && \
cd rtabmap/build && \
cmake .. && \
make && \
make install && \
cd ../.. && \
rm -rf rtabmap && \
ldconfig
+26
View File
@@ -0,0 +1,26 @@
# Image: introlab3it/rtabmap:android-deps-api19
FROM ubuntu:16.04
# Install build dependencies
RUN apt-get update && apt-get install -y \
git \
cmake \
g++ \
software-properties-common \
freeglut3-dev
ENV ANDROID_HOME=/opt/android-sdk
ENV ANDROID_NATIVE_API_LEVEL=android-19
ENV ANDROID_NDK=/opt/android-ndk-r14
ENV PATH=$PATH:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/android-ndk-r14
WORKDIR /root/
ADD setup_android_env.bash /root/setup_android_env.bash
RUN chmod +x setup_android_env.bash
RUN /bin/bash -c "./setup_android_env.bash"
ADD install_deps.bash /root/install_deps.bash
RUN chmod +x install_deps.bash
RUN /bin/bash -c "./install_deps.bash /opt/android"
+168
View File
@@ -0,0 +1,168 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "install_deps.bash android_install_prefix # Example: install_deps.bash /opt/android"
exit 1
fi
cpus=-j4
prefix=$1
pwd=$(pwd)
wget -nv https://github.com/introlab/rtabmap/raw/master/cmake_modules/android.toolchain.cmake
# Install directory for all dependencies
mkdir -p $prefix/armeabi-v7a
mkdir -p $prefix/arm64-v8a
# Boost
echo "wget boost..."
wget -nv https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
tar -xzf boost_1_59_0.tar.gz
cd boost_1_59_0
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/489ff2869eccd6f8d03ffb9090ef839108762741/BoostConfig.cmake.in
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/e7fbf0e301cfea417a7aa69989a761a4de08b8c3/CMakeLists.txt
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -r boost_1_59_0.tar.gz boost_1_59_0
# eigen
echo "wget eigen..."
wget -nv http://bitbucket.org/eigen/eigen/get/3.2.7.tar.gz
tar -xzf 3.2.7.tar.gz
cd eigen-eigen-b30b87236a1b
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -r 3.2.7.tar.gz eigen-eigen-b30b87236a1b
# FLANN
echo "wget flann..."
wget -nv http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-1.8.4-src.zip
unzip -qq flann-1.8.4-src.zip
cd flann-1.8.4-src
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -r flann-1.8.4-src.zip flann-1.8.4-src
# GTSAM
git clone https://bitbucket.org/gtborg/gtsam.git
cd gtsam
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5
# patch
wget -nv https://gist.github.com/matlabbe/726b490c658afd3293f4b3f2f501b863/raw/df09fc8e238a495d66b062d92dc1c1fb20a581e8/gtsam_GKlib_android_fix.patch
git apply gtsam_GKlib_android_fix.patch
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DMETIS_SHARED=OFF -DGTSAM_BUILD_STATIC_LIBRARY=ON -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -rf gtsam
# g2o
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_LGPL_SHARED_LIBS=OFF -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -rf g2o
#CMake 3.7 for VTK
echo "wget cmake3.7..."
wget -nv https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz
tar -xzf cmake-3.7.2-Linux-x86_64.tar.gz
rm cmake-3.7.2-Linux-x86_64.tar.gz
# VTK
git clone https://github.com/Kitware/VTK.git
cd VTK
git checkout tags/v7.1.1
mkdir build
cd build
$pwd/cmake-3.7.2-Linux-x86_64/bin/cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_ANDROID_BUILD=ON -DANDROID_ARCH_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
cp -r CMakeExternals/Install/vtk-android/* $prefix/armeabi-v7a/.
rm -r *
$pwd/cmake-3.7.2-Linux-x86_64/bin/cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DVTK_ANDROID_BUILD=ON -DANDROID_ARCH_ABI=arm64-v8a -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
cp -r CMakeExternals/Install/vtk-android/* $prefix/arm64-v8a/.
cd $pwd
rm -rf VTK cmake-3.7.2-Linux-x86_64
# PCL
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
git checkout tags/pcl-1.8.0
# patch
wget -nv https://gist.github.com/matlabbe/41812e50e459b2f27b331a2343569e5d/raw/921bbb90d5115f7aec1640f255aec3036a518553/pcl_1_8_0_vtk_android_support.patch
git apply pcl_1_8_0_vtk_android_support.patch
mkdir build
cd build
# do it 2 times because there is a cmake error on the first time and not the second time!?
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
# do it 2 times because there is a cmake error on the first time and not the second time!?
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=OFF -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=OFF -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -rf pcl
# OpenCV
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/3.4.2
cd $pwd
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/3.4.2
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DOPENCV_EXTRA_MODULES_PATH=$pwd/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ..
make $cpus
make install
rm -r *
cmake -DCMAKE_TOOLCHAIN_FILE=$pwd/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DOPENCV_EXTRA_MODULES_PATH=$pwd/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_CUDA=OFF -DCMAKE_INSTALL_PREFIX=$prefix/arm64-v8a ..
make $cpus
make install
cd $pwd
rm -rf opencv opencv_contrib
@@ -0,0 +1,126 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "install_deps_host.bash install_prefix # Example: install_deps_host.bash /usr/local"
exit 1
fi
sudo apt-get update
sudo apt-get install -y git cmake g++ software-properties-common wget unzip zlib1g-dev qtbase5-dev libqt5x11extras5-dev libqt5svg5-dev qttools5-dev libxt-dev freeglut3-dev
cpus=-j4
prefix=$1
pwd=$(pwd)
# note: we build shared libraries because there is a "multiple definition" linker error on jpeg/tiff third libraries between VTK and OpenCV (on not android build).
# Boost
echo "wget boost..."
wget -nv https://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz
tar -xzf boost_1_59_0.tar.gz
cd boost_1_59_0
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/489ff2869eccd6f8d03ffb9090ef839108762741/BoostConfig.cmake.in
wget -nv https://gist.github.com/matlabbe/0bce8feeb73a499a76afbbcc5c687221/raw/472e823a950f41d0abd78e97620bb9472dab41d3/CMakeLists.txt
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -r boost_1_59_0.tar.gz boost_1_59_0
# eigen
echo "wget eigen..."
wget -nv http://bitbucket.org/eigen/eigen/get/3.2.7.tar.gz
tar -xzf 3.2.7.tar.gz
cd eigen-eigen-b30b87236a1b
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -r 3.2.7.tar.gz eigen-eigen-b30b87236a1b
# FLANN
echo "wget flann..."
wget -nv http://www.cs.ubc.ca/research/flann/uploads/FLANN/flann-1.8.4-src.zip
unzip -qq flann-1.8.4-src.zip
cd flann-1.8.4-src
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -r flann-1.8.4-src.zip flann-1.8.4-src
# GTSAM
git clone https://bitbucket.org/gtborg/gtsam.git
cd gtsam
git checkout fbb9d3bdda8b88df51896bc401bfd170573e66f5
# patch
wget -nv https://gist.github.com/matlabbe/726b490c658afd3293f4b3f2f501b863/raw/df09fc8e238a495d66b062d92dc1c1fb20a581e8/gtsam_GKlib_android_fix.patch
git apply gtsam_GKlib_android_fix.patch
mkdir build
cd build
cmake -DMETIS_SHARED=ON -DGTSAM_BUILD_STATIC_LIBRARY=OFF -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -rf gtsam
# g2o
git clone https://github.com/RainerKuemmerle/g2o.git
cd g2o
git checkout a3f7706bdbb849b2808dc3e1b7aee189f63b498e
mkdir build
cd build
cmake -DBUILD_LGPL_SHARED_LIBS=ON -DG2O_BUILD_APPS=OFF -DG2O_BUILD_EXAMPLES=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -rf g2o
# VTK
git clone https://github.com/Kitware/VTK.git
cd VTK
git checkout tags/v7.1.1
mkdir build
cd build
cmake -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DVTK_Group_Qt=ON -DVTK_QT_VERSION=5 -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -rf VTK
# PCL
git clone https://github.com/PointCloudLibrary/pcl.git
cd pcl
git checkout tags/pcl-1.8.0
# patch
wget -nv https://gist.github.com/matlabbe/41812e50e459b2f27b331a2343569e5d/raw/921bbb90d5115f7aec1640f255aec3036a518553/pcl_1_8_0_vtk_android_support.patch
git apply pcl_1_8_0_vtk_android_support.patch
mkdir build
cd build
cmake -DBUILD_apps=OFF -DBUILD_examples=OFF -DBUILD_tools=OFF -DBUILD_visualization=ON -DBUILD_tracking=OFF -DBUILD_people=OFF -DBUILD_global_tests=OFF -DWITH_QT=ON -DWITH_OPENGL=OFF -DWITH_VTK=ON -DPCL_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -rf pcl
# OpenCV
git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/3.4.2
cd $pwd
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/3.4.2
mkdir build
cd build
cmake -DOPENCV_EXTRA_MODULES_PATH=$pwd/opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$prefix ..
make $cpus
make install
cd $pwd
rm -rf opencv opencv_contrib
@@ -0,0 +1,25 @@
#!/bin/bash
# Setup java 1.8
apt-get update
apt-get install -y --no-install-recommends apt-utils
apt-get install -y unzip wget ant
apt-get install -y default-jre default-jdk
apt-get install -y lib32stdc++6 lib32z1
# Setup android sdk
echo "wget android-sdk..."
wget -nv https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
unzip -qq tools_r25.2.3-linux.zip
rm tools_r25.2.3-linux.zip
mkdir $ANDROID_HOME
mv tools $ANDROID_HOME/.
#android list sdk --all --extended
echo y | android update sdk --no-ui --all --filter platform-tools,android-19,build-tools-19.1.0,android-21,build-tools-21.1.0
# Setup android ndk
echo "wget android-ndk..."
wget -nv https://dl.google.com/android/repository/android-ndk-r14-linux-x86_64.zip
unzip -qq android-ndk-r14-linux-x86_64.zip
rm android-ndk-r14-linux-x86_64.zip
mv android-ndk-r14 $ANDROID_NDK
@@ -0,0 +1,11 @@
# Image: introlab3it/rtabmap:tango-api19
FROM introlab3it/rtabmap:android-deps-api19
WORKDIR /root/
ADD build.bash /root/build.bash
RUN chmod +x build.bash
RUN /bin/bash -c "./build.bash /opt/android"
WORKDIR /root/
@@ -0,0 +1,54 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "build.bash android_install_prefix # Example: build.bash /opt/android"
exit 1
fi
prefix=$1
# get rtabmap
git clone https://github.com/introlab/rtabmap.git rtabmap-tango
# tango
wget 'https://docs.google.com/uc?authuser=0&id=12rHHkYM5k-UnQn-xGXs9JqYWhSXrgJr3&export=download' -O TangoSDK_Ikariotikos_C.zip
unzip -qq TangoSDK_Ikariotikos_C.zip
rm TangoSDK_Ikariotikos_C.zip
cp -r lib_tango_client_api/include/* $prefix/armeabi-v7a/include/.
cp -r lib_tango_client_api/include/* $prefix/arm64-v8a/include/.
cp -r lib_tango_client_api/lib/armeabi-v7a/* $prefix/armeabi-v7a/lib/.
cp -r lib_tango_client_api/lib/arm64-v8a/* $prefix/arm64-v8a/lib/.
rm -r lib_tango_client_api
wget 'https://docs.google.com/uc?authuser=0&id=1AqVuEVu5284X6OgrGWu12VTrx4pY99Jb&export=download' -O TangoSupport_Ikariotikos_C.zip
unzip -qq TangoSupport_Ikariotikos_C.zip
rm TangoSupport_Ikariotikos_C.zip
cp -r lib_tango_support_api/include/* $prefix/armeabi-v7a/include/.
cp -r lib_tango_support_api/include/* $prefix/arm64-v8a/include/.
cp -r lib_tango_support_api/lib/armeabi-v7a/* $prefix/armeabi-v7a/lib/.
cp -r lib_tango_support_api/lib/arm64-v8a/* $prefix/arm64-v8a/lib/.
cp -r lib_tango_support_api/lib/* rtabmap-tango/app/android/jni/third-party/lib/.
rm -r lib_tango_support_api
wget 'https://docs.google.com/uc?authuser=0&id=1s5iPJ7xiridj9Jj--gCy2XiQFniheVm6&export=download' -O TangoSDK_Ikariotikos_Java.jar
mv TangoSDK_Ikariotikos_Java.jar rtabmap-tango/app/android/libs/.
# Patch to remove not supported arcore and arengine stuff on API19
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
cd rtabmap-tango
git pull origin tango-api19
# resource tool
cd build
cmake -DANDROID_PREBUILD=ON ..
make
cd ../..
# rtabmap (do only 32 bits for api19)
mkdir rtabmap-tango/build/armeabi-v7a
cd rtabmap-tango/build/armeabi-v7a
cmake -DCMAKE_TOOLCHAIN_FILE=../../cmake_modules/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DBUILD_SHARED_LIBS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TOOLS=OFF -DCMAKE_BUILD_TYPE=Release -DOpenCV_DIR=$prefix/armeabi-v7a/sdk/native/jni -DCMAKE_INSTALL_PREFIX=$prefix/armeabi-v7a ../..
make
# package with binaries of both architectures
cp -r ../armeabi-v7a/app/android/libs/armeabi-v7a app/android/libs/.
make
@@ -0,0 +1,18 @@
# Image: introlab3it/rtabmap:tango-dev
FROM introlab3it/rtabmap:tango
WORKDIR /root/
RUN apt-get update && apt-get install -y \
vim \
eclipse \
eclipse-cdt \
eclipse-cdt-jni
RUN cp ~/rtabmap-tango/build/arm64-v8a/app/android/project.properties ~/rtabmap-tango/app/android/.
# Manual steps:
# - Install ADT plugin from Eclipse: https://stuff.mit.edu/afs/sipb/project/android/docs/sdk/installing/installing-adt.html
# - Import rtabmap project, set build command: "make -C ${ProjDirPath}/build/arm64-v8a VERBOSE=true"
# - Create Android project from source code and select rtabmap-tango/app/android directory.
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
docker build --build-arg CACHE_DATE="$(date)" --cache-from $IMAGE_NAME -f $DOCKERFILE_PATH -t $IMAGE_NAME -t $DOCKER_REPO:16.04 -t $DOCKER_REPO:latest .
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
docker push $DOCKER_REPO:16.04
docker push $DOCKER_REPO:latest