Skip to content

DockerROS2

Junichi Tokuda edited this page Sep 28, 2021 · 12 revisions

A Docker image for the ISMR Workshop tutorial was set up as follows.

Docker Image

docker-ubuntu-vnc-desktop, a Ubuntu 20.04 container with HTML5 VNC server, seems to be robust and well used by the community. The Dockerfile is available in Github, unlike some of the other similar containers. Also, the Dockerfile is written in a way that it can be built for non-Intel platforms.

ROS 2 can be integrated by replacing the base container with an official ROS 2 container. The forked repository is available in the ROSMED GitHub repository.

The Docker image will be available at Docker Hub.

TODO

We need to include the following additional packages in the container, as we did in ISMRM 2019

  • ROS-Industrial
  • ROS Universal Robot package
  • ROS MoveIt! package
  • OpenIGTLink
  • ROS-IGTL-Bridge

Building Docker Image (Not needed for end-users)

The Dockerfile repository can be obtained by cloning the repository at GitHub. Please note that '--recursive' option is required to build the image correctly.

$ git clone --recursive https://github.com/rosmed/docker-ubuntu-vnc-desktop-ros2

Please note that that we use the ismr2021 branch for the ISMR 2021 workshop. To swich:

$ cd docker-ubuntu-vnc-desktop-ros2
$ git checkout ismr2021

To build an image, run the following command:

$ docker build -t rosmed/docker-ubuntu-vnc-desktop-ros2:ismr2021 .

To push the image to Docker Hub:

$ docker push rosmed/docker-ubuntu-vnc-desktop-ros2:ismr2021

Running Docker image

If you run the image available in the Docker Hub, pull the image using the following command:

$ docker pull rosmed/docker-ubuntu-vnc-desktop-ros2:ismr2021

To execute the docker image, call the following command:

$ docker run -it --rm -p 6080:80 -p 28944:18944 rosmed/docker-ubuntu-vnc-desktop-ros2:2021

In this example, the web port on the docker container will be mapped to port 6080 on the host computer. It also maps local (host) port 28944 to the guest OS's port 18944 for OpenIGTLink connections (see below). The '--rm' option will remove the container upon termination.

Testing OpenIGTLink Connection

The docker image pulled in the previous section comes with a copy of the OpenIGTLink under /root/igtl, and can be used to test communication between an OpenIGTLink server on the guest OS and a client on the host computer. Before testing OpenIGTLink connection, make sure to install 3D Slicer with SlicerOpenIGTLink extension on the host computer.

Once the Docker image is up and running (see the previous section), open an Web brawser and access:

https://localhost:6080

Once a VNC remote desktop environment should appear on the browser window, click the button on the left end of the task bar at the bottom of the desktop to launch a start menu, and open System Tools -> LXTerminal.

Clone this wiki locally