# Tutorial 0: Getting Started :::{admonition} 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. ::::{tab-set} :::{tab-item} Linux ```console $ git --version $ docker --version $ docker compose version $ docker run hello-world ``` Expected output ```console git version 2.50.0 Docker version 29.5.1, build 123123123 Docker Compose version 5.1.0 Hello from Docker! ... ``` ::: :::{tab-item} windows ```console $ git --version $ docker --version $ docker compose version $ docker run hello-world ``` Expected output ```console 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". ```{figure} ../../_static/images/getting_started_vsc_task.png :alt: placeholder :width: 60% :align: center VSCodium task to launch container's openvscode-server. ``` Or run the command, ::::{tab-set} :::{tab-item} Linux ```console $ ``` Expected output ```console git version 2.50.0 Docker version 29.5.1, build 123123123 Docker Compose version 5.1.0 Hello from Docker! ... ``` ::: :::{tab-item} windows ```console $ git --version $ docker --version $ docker compose version $ docker run hello-world ``` Expected output ```console 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](../../setup/using_container.md). ::: ## 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](https://github.com/gitpod-io/openvscode-server) running in the `ros2-demo` container[^openvscode-server]. Direct your browser to the following URL: :::{div} center-text ::: or click the "Open VNC remote in browser" task. ```{figure} ../../_static/images/getting_started_vsc_task.png :alt: placeholder :width: 60% :align: center 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: :::{div} center-text ::: or click the "Open VNC remote in browser" task. ```{figure} ../../_static/images/getting_started_vnc_task.png :alt: placeholder :width: 60% :align: center VSCodium task to launch container's graphical shell. ``` :::{dropdown} 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! ```console $ rviz2 ``` :::{dropdown} A video of the same process:
::: [^1]: This might seem like a downside at first but having the file system this way allows us to trivially fix a broken environment by destroying and recreating a container from the same image many times. [^openvscode-server]: This is a remotely accessible VSCode editor you can connect to using a browser. Fun fact, most of VSCodium is written in js/html/css.