ga58lar / ros2-docker-example

ROS2 Docker example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docker ROS2 Tutorial

This sample should show you how you can use Docker with ROS2 in the development and in the application.

It will not guide you through every line of code (at least not yet), but should give you an inspiration on how to use docker for your module.
It enables you to look up concepts of how to write a Dockerfile, how to build an image and how to run a container.

The concept

This sample uses the almighty KISS-ICP algorithm to localize our IAC racecar (raceboss) on the Monza F1 racetrack.
The sample shows you how:
- to set up a basic image with ROS2-humble
- to set arguments (ARG)
- to COPY code to your image
- to MOUNT a directory, like ./data/ to your container
- to run a command on start-up

The content

./data/ ... storage of sample data of the IAC @ Monza.
./docker/ ... bash files to build an image and run the container
./kiss-icp/ ... the clone of the KISS-ICP GitHub repository
./Dockerfile ... the build instructions for the docker image

Prerequisites

You need following applications installed:
- Docker

Please refer to the official installation instructions for above mentioned software.

How to run the sample

From the root of this project:

tar xf data.tar.xz
chmod +x docker/build.sh docker/run.sh
./docker/build.sh
./docker/run.sh

This will build and run the content of this sample.
A seperate window with rviz2 should pop-up and you should see pointclouds and the localization path generated by KISS-ICP.

Running on a system with a NVIDIA GPU

This example will not work out of the box on computers with a NVIDIA GPU.
You have to set additional flags in the run script.
Please add following flags:

    --gpus all
    -e NVIDIA_DRIVER_CAPABILITIES=all
    -e QT_X11_NO_MITSHM=1
    --runtime=nvidia

WIP

The sample will be expanded for .devcontainer setup in the future.

About

ROS2 Docker example


Languages

Language:Dockerfile 68.4%Language:Shell 31.6%