2018-05-01 15:53:19 -04:00
|
|
|
# Image: introlab3it/rtabmap:bionic
|
|
|
|
|
|
2019-11-08 18:41:11 -05:00
|
|
|
FROM ros:melodic-perception
|
2018-05-01 15:53:19 -04:00
|
|
|
|
|
|
|
|
# Install build dependencies
|
2019-11-08 18:41:11 -05:00
|
|
|
RUN apt-get update && \
|
2021-05-12 14:01:26 -04:00
|
|
|
apt-get install -y git software-properties-common ros-melodic-rtabmap-ros && \
|
2019-11-08 18:41:11 -05:00
|
|
|
apt-get remove -y ros-melodic-rtabmap && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/
|
2018-05-01 15:53:19 -04:00
|
|
|
|
|
|
|
|
WORKDIR /root/
|
|
|
|
|
|
2018-05-02 16:10:36 -04:00
|
|
|
# GTSAM
|
2021-05-12 14:01:26 -04:00
|
|
|
RUN add-apt-repository ppa:borglab/gtsam-release-4.0 -y
|
|
|
|
|
RUN apt install libgtsam-dev libgtsam-unstable-dev -y
|
2018-05-02 16:10:36 -04:00
|
|
|
|
2018-05-03 09:11:27 -04:00
|
|
|
# libpointmatcher
|
2018-05-02 16:10:36 -04:00
|
|
|
RUN git clone https://github.com/ethz-asl/libnabo.git
|
2021-05-12 14:01:26 -04:00
|
|
|
#commit February 13 2021
|
2018-05-02 16:10:36 -04:00
|
|
|
RUN cd libnabo && \
|
2021-05-12 14:01:26 -04:00
|
|
|
git checkout 3cab7eed92bd5d4aed997347b8c8a2692a83a532 && \
|
2018-05-02 16:10:36 -04:00
|
|
|
mkdir build && \
|
|
|
|
|
cd build && \
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
2018-05-02 16:19:15 -04:00
|
|
|
make -j$(nproc) && \
|
2018-05-02 16:10:36 -04:00
|
|
|
make install && \
|
|
|
|
|
cd && \
|
|
|
|
|
rm -r libnabo
|
|
|
|
|
RUN git clone https://github.com/ethz-asl/libpointmatcher.git
|
2021-05-12 14:01:26 -04:00
|
|
|
#commit April 6 2021
|
2018-05-02 16:10:36 -04:00
|
|
|
RUN cd libpointmatcher && \
|
2021-05-12 14:01:26 -04:00
|
|
|
git checkout 76f99fce0fe69e6384102a0343fdf8d262626e1f && \
|
2018-05-02 16:10:36 -04:00
|
|
|
mkdir build && \
|
|
|
|
|
cd build && \
|
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
2018-05-02 16:19:15 -04:00
|
|
|
make -j$(nproc) && \
|
2018-05-02 16:10:36 -04:00
|
|
|
make install && \
|
|
|
|
|
cd && \
|
|
|
|
|
rm -r libpointmatcher
|
|
|
|
|
|
2021-09-30 18:00:17 -04:00
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
|
|
|
|
RUN echo "I am building for $TARGETPLATFORM"
|
|
|
|
|
|
2021-10-14 21:49:50 -04:00
|
|
|
# arm64
|
|
|
|
|
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then ln -s /usr/bin/cmake ~/cmake; fi
|
|
|
|
|
|
2021-09-30 18:00:17 -04:00
|
|
|
# cmake >=3.11 required for amd64 dependencies
|
|
|
|
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then apt install -y wget && \
|
|
|
|
|
wget -nv https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0-Linux-x86_64.tar.gz && \
|
2021-09-20 12:32:51 -04:00
|
|
|
tar -xzf cmake-3.17.0-Linux-x86_64.tar.gz && \
|
2021-09-30 18:00:17 -04:00
|
|
|
rm cmake-3.17.0-Linux-x86_64.tar.gz &&\
|
|
|
|
|
ln -s ~/cmake-3.17.0-Linux-x86_64/bin/cmake ~/cmake; fi
|
|
|
|
|
|
2021-10-14 21:49:50 -04:00
|
|
|
# AliceVision v2.4.0 modified (Sept 13 2021)
|
|
|
|
|
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
|
|
|
libsuitesparse-dev \
|
|
|
|
|
libceres-dev \
|
|
|
|
|
xorg-dev \
|
|
|
|
|
libglu1-mesa-dev; 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
|
|
|
|
|
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 && \
|
|
|
|
|
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
|
2022-07-20 15:20:14 -04:00
|
|
|
|
|
|
|
|
#commit Aug 6 2020
|
2022-07-20 22:39:41 -04:00
|
|
|
RUN apt-get update && apt install wget
|
|
|
|
|
RUN git clone https://github.com/laurentkneip/opengv.git && \
|
|
|
|
|
cd opengv && \
|
2022-07-20 15:20:14 -04:00
|
|
|
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
|
2018-05-03 09:11:27 -04:00
|
|
|
|
2021-10-16 18:14:24 -04:00
|
|
|
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
|
|
|
|
|
2022-05-28 16:11:52 -04:00
|
|
|
# Copy current source code
|
|
|
|
|
COPY . /root/rtabmap
|
2019-11-08 18:41:11 -05:00
|
|
|
|
2018-05-01 15:53:19 -04:00
|
|
|
# Build RTAB-Map project
|
2019-11-08 18:41:11 -05:00
|
|
|
RUN source /ros_entrypoint.sh && \
|
|
|
|
|
cd rtabmap/build && \
|
2022-07-20 15:20:14 -04:00
|
|
|
~/cmake -DWITH_ALICE_VISION=ON -DWITH_OPENGV=ON .. && \
|
2021-10-16 18:14:24 -04:00
|
|
|
make -j$(nproc) && \
|
2018-05-01 15:53:19 -04:00
|
|
|
make install && \
|
|
|
|
|
cd ../.. && \
|
|
|
|
|
rm -rf rtabmap && \
|
|
|
|
|
ldconfig
|
|
|
|
|
|