Skip to content
Snippets Groups Projects
Commit 3d636a0a authored by holzheim's avatar holzheim
Browse files

Updated instructions Docker

parent 49acac3c
Branches
No related tags found
No related merge requests found
Showing
with 38 additions and 3 deletions
...@@ -77,29 +77,39 @@ Follow the instructions to download the repository to your local machine and sta ...@@ -77,29 +77,39 @@ Follow the instructions to download the repository to your local machine and sta
- Open `VS Code`. - Open `VS Code`.
- Go to *File* → *Open Folder* and select in the upcoming window the folder *your_local_path/i2r/* - Go to *File* → *Open Folder* and select in the upcoming window the folder *your_local_path/i2r/*
- Terminal (Linux, macOS): - Terminal (Linux, macOS):
```bash ```bash
cd <your local path>/i2r/ cd <your local path>/i2r/
code . code .
``` ```
- Powershell (Windows) - Powershell (Windows)
```bash ```bash
``` ```
3. Open the *Terminal* in `VS Code` (*Terminal* &rarr; *New Terminal*). The path in the Terminal should be the one you selected before. 3. Open the *Terminal* in `VS Code` (*Terminal* &rarr; *New Terminal*). The path in the Terminal should be the one you selected before.
4. Now clone the repository from gitlab by copying the follwing command into the Terminal and press enter. (You are asked to enter your gitlab user name and password.) 4. Now clone the repository from gitlab by copying the follwing command into the Terminal and press enter. (You are asked to enter your gitlab user name and password.)
```bash ```bash
git clone https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023.git git clone https://git.rwth-aachen.de/introduction-to-robotics-course/introduction-to-robotics-2023.git
``` ```
- If you don't have *git* installed, you can either install it or go to the gitlab repository using the browser and download the source code into the *i2r* folder. - If you don't have *git* installed, you can either install it or go to the gitlab repository using the browser and download the source code into the *i2r* folder.
- Information on how to install git can be found for all OS [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) - Information on how to install git can be found for all OS [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
5. Now that all the files from the repository are on your local machine, change in the terminal to the folder where the *docker-compose.yml* file is stored. 5. Now that all the files from the repository are on your local machine, change in the terminal to the folder where the *docker-compose.yml* file is stored.
```bash ```bash
cd introduction-to-robotics-2023/00_GettingStarted/docker/i2r/ cd introduction-to-robotics-2023/00_GettingStarted/docker/i2r/
``` ```
6. Run the following command to spin up the scenario that is defined in the [docker-compose.yml](docker/i2r/docker-compose.yml) file.
6. Run the following command to spin up the scenario that is defined in the [docker-compose.yml](docker/i2r/docker-compose.yml) file. To be able to use all commands starting with *docker*, `Docker Desktop` has to run in the background.
```bash ```bash
docker compose up docker compose up
``` ```
This command will download the needed images and start two containers. One container named ***i2r-ros-1*** which contains a snapshot of an Ubuntu OS with ROS and additional packages installed. The second container is an auxiliary container named ***i2r-gui-1*** that will be used to inspect graphical user interfaces of applications started in the i2r-ros-1 container. This command will download the needed images and start two containers. One container named ***i2r-ros-1*** which contains a snapshot of an Ubuntu OS with ROS and additional packages installed. The second container is an auxiliary container named ***i2r-gui-1*** that will be used to inspect graphical user interfaces of applications started in the i2r-ros-1 container.
The terminal output will look the following: The terminal output will look the following:
...@@ -110,11 +120,15 @@ Follow the instructions to download the repository to your local machine and sta ...@@ -110,11 +120,15 @@ Follow the instructions to download the repository to your local machine and sta
![Docker Desktop GUI with group of containers running](images/docker_group_running.png)*`Docker Desktop` GUI: Inside the Containers tab you should find the started group of containers.* ![Docker Desktop GUI with group of containers running](images/docker_group_running.png)*`Docker Desktop` GUI: Inside the Containers tab you should find the started group of containers.*
- Another option to inspect the containers is using the terminal. (Note: If you are still in the terimal you executed the *docker compose up*, make sure to start a new terminl, but let the old terminal running.) - Another option to inspect the containers is using the terminal. (Note: If you are still in the terimal you executed the *docker compose up*, make sure to start a new terminl, but let the old terminal running.)
```bash ```bash
docker ps --all docker ps --all
``` ```
The terminal output will look the following: The terminal output will look the following:
![Terminal output for *docker ps --all*](images/docker_ps_all.gif) ![Terminal output for *docker ps --all*](images/docker_ps_all.gif)
There will be information like ID of the container, name of the image the container was build from etc. There will be information like ID of the container, name of the image the container was build from etc.
8. To connect to the ***i2r-ros-1*** container, the container we will use to work with `ROS`, execute the following command from terminal: 8. To connect to the ***i2r-ros-1*** container, the container we will use to work with `ROS`, execute the following command from terminal:
...@@ -136,6 +150,27 @@ Follow the instructions to download the repository to your local machine and sta ...@@ -136,6 +150,27 @@ Follow the instructions to download the repository to your local machine and sta
If that worked out, you can again close the the started *ROS Master* by typing *`Ctrl` + `C`*. That shuts down the *Master* node. To leave the *bash* session inside of the *i2r-ros-1 container* just type *`Ctrl` + `D`*. If that worked out, you can again close the the started *ROS Master* by typing *`Ctrl` + `C`*. That shuts down the *Master* node. To leave the *bash* session inside of the *i2r-ros-1 container* just type *`Ctrl` + `D`*.
![GIF: Terminal output kill master and leave container session.](images/kill_master_leave_container.gif) ![GIF: Terminal output kill master and leave container session.](images/kill_master_leave_container.gif)
10. To stop the started group of containers named *i2r* you can either use the `Docker Desktop` GUI from the *Container* tab like shown below.
![GIF: Terminal output stop container group from GUI.](images/stopping_container_group_from_gui.gif)
Or switch again to the terminal, where you run the *docker compose up* command and press *`Ctrl` + `C`*.
![GIF: Terminal output container group from terminal.](images/stopping_container_group.gif)
11. If all the previous steps worked you have successfully installed the envrionment we will be using during in `Introduction to Robotics` to work with `ROS`.
If you want to restart a container just make sure that:
- `Docker Desktop` is running and
- start the group of containers named *i2r* by using ...
- GUI or
![GIF: Starting container group from GUI.](images/starting_container_group_from_gui.gif)
- Terminal
![GIF: Starting container group from Terminal.](images/starting_container_group_from_terminal.gif)
## In case of problems ## In case of problems
......
Image diff could not be displayed: it is too large. Options to address this: view the blob.
No preview for this file type
00_GettingStarted/images/starting_container_group_from_gui.gif

415 KiB

File added
Image diff could not be displayed: it is too large. Options to address this: view the blob.
File added
00_GettingStarted/images/stopping_container_group.gif

1.4 MiB

No preview for this file type
Image diff could not be displayed: it is too large. Options to address this: view the blob.
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment