Skip to content

Docker image for running gazebo simulations with accelerated GUI

Notifications You must be signed in to change notification settings

johncarl81/gazebo_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ROS2 Gazebo Simulation Docker Image

This repository contains a starting point to building and running a simple Gazebo Docker image.

This repository is based on the work of the following:

  1. Tutorial standing up Bubble-Bot simulation (blog): http://moore-mike.com/docker-ros.html#docker-ros

  2. Repository from Davide Faconti with some guidance on using nvidia integration: https://github.com/facontidavide/ros-docker-gazebo

  3. Tutorial by Brett Israelsen (blog): https://bisraelsen.github.io/2017/docker/

Step 1: Install Docker

TLDR:
sudo apt install docker.io

To run docker without super user:

sudo groupadd docker
sudo gpasswd -a ${USER} docker
sudo service docker restart

Step 2: Setup NVIDIA acceleration

Install nvidia-docker (to get HW acceleration) https://github.com/NVIDIA/nvidia-docker/wiki

TLDR:
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo apt install curl
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list


# install the nvidia docker support packages
sudo apt update
sudo apt install nvidia-container-toolkit

# restart the docker daemon with nvidia support
sudo systemctl restart docker

Step 3: Create the container

This repository contains a basic Dockerfile under docker/Dockerfile with the bones necessary to start up a Gazebo simulation. To build, simply run the ./build.sh script in the root. This may require you to log into docker.io.

Step 4: Run the container

Finally, if everything finished without error, simply run the ./run.sh script to standup the Gazebo simuation docker container. You should see this GUI appear:

gazebo

About

Docker image for running gazebo simulations with accelerated GUI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published