From 621d4d31394638945a9dbe3bcdf6d5123275df91 Mon Sep 17 00:00:00 2001 From: "k.koide" Date: Wed, 26 Jun 2024 12:13:21 +0900 Subject: [PATCH] add dockerfiles with superglue --- docker/humble/Dockerfile_with_superglue | 51 +++++++++++++++++++++++++ docker/noetic/Dockerfile_with_superglue | 50 ++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 docker/humble/Dockerfile_with_superglue create mode 100644 docker/noetic/Dockerfile_with_superglue diff --git a/docker/humble/Dockerfile_with_superglue b/docker/humble/Dockerfile_with_superglue new file mode 100644 index 0000000..d6593e0 --- /dev/null +++ b/docker/humble/Dockerfile_with_superglue @@ -0,0 +1,51 @@ +FROM koide3/gtsam_docker:humble + +RUN apt-fast update \ + && apt-fast install -y --no-install-recommends \ + libomp-dev libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /root +RUN git clone https://github.com/ceres-solver/ceres-solver \ + && mkdir ceres-solver/build \ + && cd ceres-solver/build \ + && cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DUSE_CUDA=OFF \ + && make -j$(nproc) \ + && make install \ + && rm -rf /root/ceres-solver + +COPY . /root/ros2_ws/src/direct_visual_lidar_calibration + +WORKDIR /root/ros2_ws + +RUN apt-fast update && \ + rosdep install -i --from-paths src --simulate | \ + sed '1d' | sed 's/apt-get install//' | sed 's/ //g' > /tmp/depends && \ + xargs apt-fast install --no-install-recommends -y < /tmp/depends && \ + apt-fast clean && \ + rm -rf /var/lib/apt/lists/* + +RUN /bin/bash -c ". /opt/ros/humble/setup.bash; colcon build" + +RUN echo "#!/bin/bash" >> /ros_entrypoint.sh \ + && echo "set -e" >> /ros_entrypoint.sh \ + && echo "source /opt/ros/humble/setup.bash" >> /ros_entrypoint.sh \ + && echo "source /root/ros2_ws/install/setup.bash" >> /ros_entrypoint.sh \ + && echo 'exec "$@"' >> /ros_entrypoint.sh \ + && chmod a+x /ros_entrypoint.sh + +WORKDIR /root/ros2_ws/src/direct_visual_lidar_calibration + +RUN apt-fast update \ + && apt-fast install -y --no-install-recommends \ + python3-pip python3-numpy python3-torch python3-torchvision python3-matplotlib python3-opencv \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/magicleap/SuperGluePretrainedNetwork /root/SuperGlue +ENV PYTHONPATH=$PYTHONPATH:/root/SuperGlue + + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["bash"] diff --git a/docker/noetic/Dockerfile_with_superglue b/docker/noetic/Dockerfile_with_superglue new file mode 100644 index 0000000..fb9660b --- /dev/null +++ b/docker/noetic/Dockerfile_with_superglue @@ -0,0 +1,50 @@ +FROM koide3/gtsam_docker:noetic + +RUN apt-fast update \ + && apt-fast install -y --no-install-recommends \ + libomp-dev libgoogle-glog-dev libgflags-dev libatlas-base-dev libsuitesparse-dev \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /root +RUN git clone https://github.com/ceres-solver/ceres-solver \ + && mkdir ceres-solver/build \ + && cd ceres-solver/build \ + && cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DUSE_CUDA=OFF \ + && make -j$(nproc) \ + && make install \ + && rm -rf /root/ceres-solver + +COPY . /root/catkin_ws/src/direct_visual_lidar_calibration + +WORKDIR /root/catkin_ws + +RUN apt-fast update && \ + rosdep install -i --from-paths src --simulate | \ + sed '1d' | sed 's/apt-get install//' | sed 's/ //g' > /tmp/depends && \ + xargs apt-fast install --no-install-recommends -y < /tmp/depends && \ + apt-fast clean && \ + rm -rf /var/lib/apt/lists/* + +RUN /bin/bash -c ". /opt/ros/noetic/setup.bash; catkin_make" + +RUN echo "#!/bin/bash" >> /ros_entrypoint.sh \ + && echo "set -e" >> /ros_entrypoint.sh \ + && echo "source /opt/ros/noetic/setup.bash" >> /ros_entrypoint.sh \ + && echo "source /root/catkin_ws/devel/setup.bash" >> /ros_entrypoint.sh \ + && echo 'exec "$@"' >> /ros_entrypoint.sh \ + && chmod a+x /ros_entrypoint.sh + +WORKDIR /root/catkin_ws/src/direct_visual_lidar_calibration + +RUN apt-fast update \ + && apt-fast install -y --no-install-recommends \ + python3-pip python3-numpy python3-torch python3-torchvision python3-matplotlib python3-opencv \ + && apt-fast clean \ + && rm -rf /var/lib/apt/lists/* + +RUN git clone https://github.com/magicleap/SuperGluePretrainedNetwork /root/SuperGlue +ENV PYTHONPATH=$PYTHONPATH:/root/SuperGlue + +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["bash"]