Git Product home page Git Product logo

slam-dockerfile-cheatsheet's Introduction

SLAM-dockerfile-cheatsheet

Motivation

SLAM(simultaneous localization and mapping) have different dependencies for each algorithm. Adjusting these all dependencies to the local computer is very challenging. Docker is a powerful tool, you could solve these problem at once.

This repository helps you to make Dockerfile easier what you want.
Install necessary packages or algorithms using this Cheatsheet! ๐Ÿ˜„

Table of Contents

Useful Dockerfile commands

Supported by ChatGPT & Reference

  • FROM : Specifies the base image that will be used for the Docker image.
  • WORKDIR : Sets the working directory for subsequent commands in the Dockerfile.
  • RUN : Runs a command inside the Docker image during the build process. This can be used to install packages, run scripts, and perform other setup tasks.
  • COPY or ADD : Copies files from the host machine to the Docker image. This can be used to add application code, configuration files, and other assets to the image.
  • ENV : Sets environment variables inside the Docker image.
  • CMD or ENTRYPOINT: Specifies the command that will be executed when the container is started. CMD is used to specify a default command, while ENTRYPOINT is used to specify a command that should always be run when the container is started.

Useful Docker image

Useful Packages

Ceres-solver

If you want to change the version of Ceres-solver, you just change 1.14.0 version you want.

# Install the required packages
RUN apt-get update && apt-get install libatlas-base-dev libgoogle-glog-dev libsuitesparse-dev libglew-dev

# Install ceres-solver
WORKDIR /home/thirdParty
RUN wget https://github.com/ceres-solver/ceres-solver/archive/refs/tags/1.14.0.tar.gz
RUN tar zxf 1.14.0.tar.gz
RUN cd ceres-solver-1.14.0
RUN mkdir build && cd build
RUN cmake -DCMAKE_BUILD_TYPE=Release ./ceres-solver-1.14.0 && make -j2 && make install

GTSAM

If you want to change the version of GTSAM, you just change 4.0.2 version you want.

# Install GTSAM
WORKDIR /home/thirdParty
RUN wget -O gtsam.zip https://github.com/borglab/gtsam/archive/4.0.2.zip
RUN unzip gtsam.zip
WORKDIR /home/thirdParty/gtsam-4.0.2
RUN mkdir build && cd build
RUN cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF .. && make -j2 && make install

# Solving linking issue (optional)
# Fix error related to GTSAM 
# ref: https://github.com/borglab/gtsam/issues/380
export LD_LIBRARY_PATH=/usr/local/lib/:$LD_LIBRARY_PATH

OpenCV

If you want to change the version of OpenCV, you just change 3.4.13 version you want.

WORKDIR /home/
RUN wget -O opencv.zip https://github.com/opencv/opencv/archive/3.4.13.zip
RUN wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/3.4.13.zip
RUN unzip opencv.zip && unzip opencv_contrib.zip

WORKDIR /home/opencv_build
RUN cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-3.4.13/modules -DOPENCV_ENABLE_NONFREE=ON ../opencv-3.4.13
RUN make -j$(nproc) && make install

Livox SDK

More information for dependency at Livox-SDK2 github

# Install livox SDK
WORKDIR /root/
RUN git clone https://github.com/Livox-SDK/Livox-SDK2.git
WORKDIR /root/Livox-SDK2
RUN mkdir build
WORKDIR /root/Livox-SDK2/build
RUN cmake .. && make -j2 && make install

Livox ROS driver

Create a folder for the livox ros driver in catkin_ws/src and build it directly.
If you want to change the version of livox ros driver, you just change 2.6.0 version you want.

WORKDIR /home/catkin_ws/src
RUN wget https://github.com/Livox-SDK/livox_ros_driver/archive/refs/tags/v2.6.0.tar.gz
RUN tar zxf v2.6.0.tar.gz && rm -rf v2.6.0.tar.gz
RUN /bin/bash -c '. /opt/ros/melodic/setup.bash; catkin_init_workspace; cd .. && catkin_make'

Pangolin

# Install Pangolin
WORKDIR /home/thirdParty
RUN git clone --recursive https://github.com/stevenlovegrove/Pangolin.git
WORKDIR /home/thirdParty/Pangolin/build
RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../install/ ..
RUN make -j2 && make install

If you have any questions, feel free to leave an issue!
Pull requests for useful package additions are always welcome. ๐Ÿ˜„

slam-dockerfile-cheatsheet's People

Contributors

taeyoung96 avatar

Stargazers

Max Weng avatar Arslan avatar Ma avatar Bruno Santos avatar Yonghye Kwon avatar

Watchers

 avatar

Forkers

yznmur

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.