diff --git a/getting-started-with-ubuntu/_data/navigation.yml b/getting-started-with-ubuntu/_data/navigation.yml old mode 100644 new mode 100755 index ef8a2e4..e81c145 --- a/getting-started-with-ubuntu/_data/navigation.yml +++ b/getting-started-with-ubuntu/_data/navigation.yml @@ -17,8 +17,10 @@ docs: children: - title: "Linux" url: /modules/1/linux.html - - title: "Installation" + - title: "Installation with VM" url: /modules/1/installation.html + - title: "Installation with Docker" + url: /modules/1/installation-docker.html - title: "Commandline" url: /modules/1/commandline.html - title: "Assessment" diff --git a/getting-started-with-ubuntu/_modules/mod-1a-linux.md b/getting-started-with-ubuntu/_modules/mod-1a-linux.md index e474ce2..47a7e69 100644 --- a/getting-started-with-ubuntu/_modules/mod-1a-linux.md +++ b/getting-started-with-ubuntu/_modules/mod-1a-linux.md @@ -16,7 +16,7 @@ Why is it important to consider an OS within a robot? The OS allocates resources For our purpose, we will take a look at the command line, i.e., a user interface that based on commands typed with the keyboard, and useful commands that we will encounter throughout the curriculum. This is an important skill to know as it is the base for configuring robots, as typically they do not have any screen on-board, as well as to work on servers in the cloud. -Let's dive into the steps of installing a new instance of Ubuntu on a Virtual Machine in the [next unit]({{ site.baseurl }}{% link _modules/mod-1b-installation.md %}) -- if you already have a machine with Ubuntu you can skip the following unit. +Let's dive into the steps of installing a new instance of Ubuntu on a Virtual Machine in the [next unit]({{ site.baseurl }}{% link _modules/mod-1b-installation-vm.md %}) -- if you already have a machine with Ubuntu you can skip the following unit. {% capture ref %} diff --git a/getting-started-with-ubuntu/_modules/mod-1b-installation-docker.md b/getting-started-with-ubuntu/_modules/mod-1b-installation-docker.md new file mode 100755 index 0000000..d7ce8cc --- /dev/null +++ b/getting-started-with-ubuntu/_modules/mod-1b-installation-docker.md @@ -0,0 +1,72 @@ +--- +title: Installation with Docker +permalink: /modules/1/installation-docker.html +--- + +Another way to work with Linux and software, regardless of the machine used, is through Docker. From a very high-level view, Docker is similar to a virtual machine in that it is possible to run another operating system in any machine. One of the main differences is that Docker's objective is to provide software in packages called **containers**, rather than a full virtual machine. The necessary software and specific versions are specified in a "recipe" file, called `Dockerfile`. This choice allows Docker containers to be lightweight compared to a regular virtual machine. +More details can be found on the [Docker website](https://www.docker.com/resources/what-container). + +For the purpose of this robotics curriculum, we will use a readily available container that has installed ROS melodic. As the Docker container is lightweight, it does not provide a direct visualization system as in other virtual machines. We will have the graphical user interface through a graphical desktop-sharing system through VNC, Virtual Network Computing. + +To get the environment ready, please follow the [Docker installation instructions](https://docs.docker.com/get-docker/) for your Operating System. + +Once installed, please run Docker. The following window will appear. + +![Docker first image](/img/docker-first.png) + +Install also git on your computer, following [these instructions](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) for your system. + +Once installed, you can open your terminal and run the following command + + git clone https://github.com/quattrinili/vnc-ros.git + +which will create a folder called `vnc-ros` in the current directory. The current directory could be changed using the `cd` command, e.g., in Linux-based system, to have `vnc-ros` in the `Desktop` folder of the current user, type `cd ~/Desktop`, before the `git` command. + +Then, enter the created folder + + cd vnc-ros + +At this point you can run the following command to "configure and turn on the container" -- you can think about this step as installing the operating system and turning on the computer: + + docker-compose up --build + +Open a new terminal, go to the folder `vnc-ros` and run the following command + + docker-compose exec ros bash + +which will allow you to have a terminal connected to that container, where you can run the commands we will see in this module. This command can be run only after the `docker-compose up --build` as otherwise it will fail, as the container wouldn't be up and running. If it runs correctly, you would see in the terminal, something like: + + root@e75b5d66b0b9:~/catkin_ws + +which will demonstrate that now you are in the terminal of the docker container running. At this point any commands we will see later should run. + +There is a folder that is shared between the container and your system, called `catkin_ws` in the Docker and `vnc-ros/workspace` in your system. Any file added/modified/removed in the Docker will be visible to your system and vice versa. + +Note that modification to the system, such as installation of new software packages, might not be permanent outside of that shared folder. The best practice is to include the necessary software in `Dockerfile`. + +You can run multiple terminals by repeating the steps for `docker-compose exec ros bash`. + +To visualize software that shows a graphical user interface, you can: + +1) Open your favorite browser, + +2) go to the following address `localhost:8080/vnc.html` + +3) click "Connect" + +The screen will show the "desktop" of the container. + +![Docker vnc](/img/docker-vnc.png) + +This desktop should be only used as a way to display, rather than running commands. The commands should be run through the terminal. + +A full discussion on Docker can be found [here](https://docker-curriculum.com/). + +----- +Now that we have a functioning machine, let's dive into the main commands from the command line in the [next unit]({{ site.baseurl }}{% link _modules/mod-1c-commandline.md %}). + + +{% capture ref %} +{% bibliography --cited %} +{% endcapture %} +{% include references.html ref=ref %} diff --git a/getting-started-with-ubuntu/_modules/mod-1b-installation.md b/getting-started-with-ubuntu/_modules/mod-1b-installation-vm.md old mode 100644 new mode 100755 similarity index 86% rename from getting-started-with-ubuntu/_modules/mod-1b-installation.md rename to getting-started-with-ubuntu/_modules/mod-1b-installation-vm.md index 74742d4..a1b6f5d --- a/getting-started-with-ubuntu/_modules/mod-1b-installation.md +++ b/getting-started-with-ubuntu/_modules/mod-1b-installation-vm.md @@ -22,7 +22,7 @@ Note that steps 2., 3., and 4., listed above would not be that different from an A full discussion on Ubuntu is in its official book {% cite hill2016official %}. -Now that we have a functioning machine, let's dive into the main commands from the command line in the [next unit]({{ site.baseurl }}{% link _modules/mod-1c-commandline.md %}). +Now that we have a functioning machine, let's dive into the main commands from the command line in the [related unit]({{ site.baseurl }}{% link _modules/mod-1c-commandline.md %}). You're welcome to explore how a Linux system can be set up in Docker in [the next unit]({{ site.baseurl }}{% link _modules/mod-1b-installation-docker.md %}). {% capture ref %} diff --git a/getting-started-with-ubuntu/img/docker-first.png b/getting-started-with-ubuntu/img/docker-first.png new file mode 100755 index 0000000..d2557e1 Binary files /dev/null and b/getting-started-with-ubuntu/img/docker-first.png differ diff --git a/getting-started-with-ubuntu/img/docker-vnc.png b/getting-started-with-ubuntu/img/docker-vnc.png new file mode 100755 index 0000000..5772c20 Binary files /dev/null and b/getting-started-with-ubuntu/img/docker-vnc.png differ