Tutorial 0: Getting Started#

Learning Objectives

  • Confirm your setup is correct.

  • How to edit files in the container.

  • How to view the container’s graphical shell.

  • How to run a python script in the container.

Confirm Your Setup is Correct#


TODO: git, cloned repo, docker and docker compose on PATH, container running.

$ git --version
$ docker --version
$ docker compose version
$ docker run hello-world

Expected output

 git version 2.50.0
 Docker version 29.5.1, build 123123123
 Docker Compose version 5.1.0
 Hello from Docker!
 ...
$ git --version
$ docker --version
$ docker compose version
$ docker run hello-world

Expected output

 git version 2.50.0
 Docker version 29.5.1, build 123123123
 Docker Compose version 5.1.0
 Hello from Docker!
 ...

To start the ros2-demo container use the task “Start ROS 2 container”.

placeholder

VSCodium task to launch container’s openvscode-server.#

Or run the command,

$ 

Expected output

 git version 2.50.0
 Docker version 29.5.1, build 123123123
 Docker Compose version 5.1.0
 Hello from Docker!
 ...
$ git --version
$ docker --version
$ docker compose version
$ docker run hello-world

Expected output

 git version 2.50.0
 Docker version 29.5.1, build 123123123
 Docker Compose version 5.1.0
 Hello from Docker!
 ...

Note

The container ros2-demo must be running! For instructions on starting/stopping the container see: Using The ROS2 Demo Container.

Editing Files in the Container#


Caution

The container filesystem is ephemeral. Only files in /home/robot/ros2-vsc-demo/ will persist across container destruction/recreation. If you save or edit files elsewhere in the container those changes will be lost next time the container is destroyed or recreated![1]

There are N ways to edit files in the running container. Here we will show how to connect to the openvscode-server running in the ros2-demo container[2]. Direct your browser to the following URL:

or click the “Open VNC remote in browser” task.

placeholder

VSCodium task to launch container’s openvscode-server.#

Using the Container’s Graphical Shell#


To use the graphical shell (desktop environment) of the Ubuntu container we can direct our browser to:

or click the “Open VNC remote in browser” task.

placeholder

VSCodium task to launch container’s graphical shell.#

TODO: Video

Running graphical programs in the container#

Try running a graphical program from either the VSC integrated terminal, or the shell in the VNC view. Either will make a graphical window appear!

$ rviz2

A video of the same process: