/ros-desktop-docker

Dockerized ROS Desktop environment for development and experimentation used by TalTech IVAR Lab.

Primary LanguageDockerfileGNU General Public License v3.0GPL-3.0

ROS Desktop Docker

Ubuntu version ROS version GitHub Workflow Status Docker Image Size (latest by date)

Based on the taltechivarlab/ubuntu-desktop:20.04 image by TalTech IVAR Lab

Dockerized ROS Desktop environment for development and experimentation used by TalTech IVAR Lab.

Why and how

Learn why this project was created and how it is useful by reading our Motivation doc.

What's included

In addition to what is already in taltechivarlab/ubuntu-desktop:20.04, this image adds modifications required for ROS development:

  • Full ROS Noetic Desktop installation
  • Preconfigured empty catkin workspace at /config/ros/ws_ivar_lab
  • Updated .bashrc and .zshrc (for the default abc user):
    • ROS is sourced automatically
    • Default workspace (ws_ivar_lab) is sourced automatically
    • Predefined environment variables:
      • ROS_WS_NAME="ws_ivar_lab"
      • ROS_WS_PATH="/config/ros/ws_ivar_lab"
  • Desktop look: desktop screenshot from ros desktop docker

For the full list of preinstalled ROS packages please refer to this repo's Dockerfile.

Usage

Quick start

Once you have installed Docker, to launch the container directly:

docker run -d \
  --name=ros-desktop \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/Tallinn \
  -p 3390:3390 `# rdp` \
  -p 2222:2222 `# ssh` \
  -p 11311:11311 `# ros master node` \
  --shm-size="1gb" \
  --security-opt seccomp=unconfined \
  --restart unless-stopped \
  taltechivarlab/ros-desktop:noetic

Once the container has started, you must ssh into it (default password is abc):

ssh abc@localhost -p 2222

...and change abc user's default password following the displayed instructions.

After that, you can use login abc and the newly set password to log in to the container using any remote desktop client.

💡 When inside the container, you can switch your default shell to [Zsh][presto-prezto_demo] by running the following command in the terminal:

sudo usermod --shell $(command -v zsh) abc

☝ You can stop and restart the created container from Docker without losing your data. It is equivalent to system shutdown from the containerized Ubuntu's point of view. However, keep in mind that deleting your container will destroy all the data and software contained inside.

💡 If you intend to connect to your ROS nodes from outside this container, you will likely need to open more ports. To learn how to do that, refer to the advanced usage section below.

Advanced usage

For more advanced use cases, such as opening additional ports and enabling hardware graphics acceleration, please refer to the Advanced Usage doc.

Building locally

If you want to build this image locally instead of pulling it from Dockerhub, clone this repository and run the build:

docker build -t taltechivarlab/ros-desktop:noetic .

In case you want to build a multi-architecture image (e.g. to run it on a Raspberry Pi), you can build for multiple platforms using the Docker Buildx backend (by specifying them in the --platform flag):

docker buildx build --platform=linux/amd64,linux/arm64 -t taltechivarlab/ros-desktop:noetic --output=oci .

Contributing

The project is in early stages of development, so we are not yet accepting contributions from outside our university organization.