Docker container with CUDA + X11(GUI) Support + Ubuntu 22.04
| ORB-SLAM3 Dockerized |
|---|
![]() |
This guide will walk you through setting up ORB-SLAM3 in a Docker container, running it with a EuRoC dataset, and testing it with different configurations like Monocular, Monocular-Inertial, and Stereo.
Important
Communication between ORB-SLAM3 is done with sockets in this example. Real world applications usually use ROS communication protocol.
- Docker
- NVIDIA GPU and drivers with CUDA support for GPU acceleration
- X11 server running for displaying graphical applications
Build the Docker image:
docker build -t orb_slam3:latest .Run the container with GPU support and X11 forwarding for graphical output:
docker run -it --gpus all --env="DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--name orb_slam3_container \
orb_slam3:latestInside the container download and set up the EuRoC MAV dataset:
cd /opt/orb_slam3
# Create directory for dataset
mkdir -p Datasets/EuRoc
cd Datasets/EuRoc/
# Download the dataset
wget -c http://robotics.ethz.ch/~asl-datasets/ijrr_euroc_mav_dataset/machine_hall/MH_01_easy/MH_01_easy.zip
# Create a directory for MH_01_easy dataset and extract it
mkdir MH01
unzip MH_01_easy.zip -d MH01/To run graphical applications inside the container:
apt-get update && apt-get install -y x11-appsTest the X11 setup:
xclock[!check] You should see a clock window appear on your screen. If it works, your X11 forwarding is configured correctly.
Navigate to the ORB-SLAM3 directory and run the examples:
./Examples/Stereo/stereo_euroc ./Vocabulary/ORBvoc.txt \
./Examples/Stereo/EuRoC.yaml \
../Datasets/EuRoc/MH01 \
./Examples/Stereo/EuRoC_TimeStamps/MH01.txt dataset-MH01_stereoStart X11 Server to forward video feed.
