Before we can get started in class, you will need to setup a few things on your computer. If something goes wrong during the semester, you may need to repeat some of these steps. If you have any trouble while installing please reach out on the class slack workspace.
We will use git to manage code in this class. This will be the way that you submit solutions to assignments and receive class code from the instructor. This step only needs to be performed ONCE for the semester. You will use the same git repo for all assignments and labs (except possibly the final project).
These instructions are designed for use on github.com. They may work using other git services, but for simplicity, only instructions for GitHub are provided. Please let the instructor know if you use a service besides GitHub.
Now you have a place to store your code for the semester that only you and the instructor can see.
It is highly recommended to use Linux in this class to complete the homework assignments and develop on the robot. Both Ubuntu 18.04 and Ubuntu 20.04 are supported by the current version of Duckietown software. Either should work, but the instructions in this guide assume you are using Ubuntu 20.04. If your computer cannot support this please reach out to the instructor. The only reason this step will need to be rerun is if your Linux install becomes corrupted (not very likely).
Regardless of the method you chose, you should now have a Linux install ready to continue. This is a good time to work on a tutorial if you are unfamiliar with the Linux command line: https://ryanstutorials.net/linuxtutorial/
The following commands are intended to be run from a Linux command-line terminal. Commands are tested in Ubuntu 20.04 and may need minor modifications to run in Ubuntu 18.04.
$ sudo apt install docker.io
You should only need to do this once on a Linux system.
$ sudo usermod -aG docker ${USER}
$ sudo apt install -y python3-pip git git-lfs $ pip3 install --no-cache-dir --user -U duckietown-shell
NOTES:
$ dts --set-version daffy
(If you see a prompt that looks like (Cmd) here then type exit to leave dts)
$ docker run hello-world
You should see the following output:
Hello from Docker!
This message shows that your installation appears to be working correctly.
If not, rerun steps 2 and 4.
$ ssh-keygen
For more info, see this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys-on-ubuntu-20-04
$ cat ~/.ssh/id_rsa.pub
$ git clone <repo_url>
Note that this will clone your repo into your current folder as a new folder with whatever name you gave your repo on GitHub. You may need to clone your repo a few times in class. It is fairly easy to break your local copy, but it is even easier to download a fresh copy from GitHub and try again! Just run the clone command again.
$ git config --global user.name "<your-name>" $ git config --global user.email "<your-email>"
cd <your-git-repo-directory>
$ gedit Dockerfile
$ git status
You should see that Dockerfile has changed.
$ git add Dockerfile
$ git commit -m "updated dockerfile"
It is always a good idea to use a descriptive log message (the part in quotes after -m) so you keep track of when you made what changes. You can put whatever text you want inside the quotes.
$ git push origin master
If you check your GitHub page after this step you should see a new commit with these changes to the Dockerfile.
Now you should be ready to proceed with assignments.