User Tools

Site Tools


Writing /var/lib/dokuwiki/data/meta/tutorials/ros_in_docker.meta failed
tutorials:ros_in_docker

Using ROS 1 in a Docker Container

In this tutorial will going to configure Docker for use a container with the latest stable version of ROS 1. This configuration have these features:

  • Launch terminals inside the container
  • Launch graphical applications from the container
  • Use your configured users inside the container
  • Share your home directory with the container

Prerequisites

We need to install xorg-xhost utility for launching graphical apps inside the container. If you use Debian as OS, you can run the next instruction:

$ sudo apt install x11-xserver-utils

Installing Docker

For installing Docker we can follow the instructions from Docker official page. If you use Debian as OS, you can follow the next link:

If you use another OS, follow the instructions for that OS

Installing ROS container

After installing Docker, we have to download the latest ROS stable to use with Docker. For these, run the next instruction:

$ sudo docker pull osrf/ros:melodic-desktop-full

Installing helper scripts

We going to use two helper scripts developed by Javier Peralta, roscreate.sh and rosterm.sh. The first one configures and runs the container, and the second creates an extra terminal inside the container. You can download these scripts from here.

After downloading the helper scripts, we going to give them execution permissions and move it to a defined directory for calling customs scripts and programs.

$ chmod +x roscreate.sh rosterm.sh
$ sudo mv roscreate.sh rosterm.sh /usr/local/bin

Running ROS Container

For running ROS, we first execute roscreate.sh:

$ roscreate.sh

Running this first script will bring a terminal inside the container with all the ROS setup already configured. If we need another terminal inside the container, we execute rosterm.sh:

$ rosterm.sh

Execute this script as many times we need. For exiting the container, we only need to exit from every terminal.

tutorials/ros_in_docker.txt · Last modified: 2022/09/20 00:08 (external edit)