Overview

The goals for this section:

  1. Learn to navigate in a Unix OS with terminal commands
  2. Learn to use Git to create and track software developement
  3. Learn to write Python and Shell exectuables

Working with Unix Terminal

Complete the following tasks using terminal commands only. Don't use the graphical interface and save those commands (in your mind) as you will need them later.

Task 1.1 — Cleanup. Remove directory ~/autonomy_ws if it exists. This may be leftover from a previous section.

Task 1.2 – Create workspace. Pick a name for the directory that would host your robot autonomy code in the future. For the reset of this document, we use <repo> to denote the directory name you chose. Create a nested directory at ∼/autonomy_ws/src/<repo>.

Task 1.3 – Add a README. Create a README.md file in <repo> you just created, and add a title to it. For example,

# We Build Autonomous Robots

Hint: you may use your favorite code editing software to edit the README file, For example, you can launch VSCode to edit any file with the following command,

code <path>/<to>/<file>

Other code editing software works as well, e.g. vim, nano, emacs, etc.

Checkpoint — Check with CA

Cheat Sheets

  1. Special Directories

    ~  # home directory
    .  # current directory
    .. # parent directory
    /  # root directory
    
  2. File System Commands

    pwd             # print out the current working directory
    ls              # list all files and sub-directories under pwd
    ls -l <file>    # show permissions (read, write, executable) of <file>
    cd <dir>        # change current directory to <dir>
    mkdir <dir>     # create a single directory at <dir>
    mkdir -p <dir>  # create a possibly nested directory at <dir>
    mv <A> <B>      # rename file <A> to file <B>
    cp <A> <B>      # copy file <A> to file <B>
    rm <file>       # remove a single <file>
    rm -r <dir>     # remove a directory <dir> and everything in it
    rm -rf <dir>    # same as above but also work if <dir> does not exist
    touch <file>    # create an empty <file>
    chmod +x <file> # make <file> executable
    chmod -w <file> # make <file> read-only
    cat <file>      # print all the content of <file>
    du -sh <dir>    # show total size of directory <dir>
    

Using git