Lab 0: Preparation
General Information
Here are some general ideas that can help you get prepared for this lab section.
When working with robots, we need skills in Linux, ROS, Python, Git/GitHub, and Virtual Machine (VM).
The best way to learn Linux is to spend time playing with it. It’s just like the first time you had your Windows/Mac computer. Additionally, you may follow some tutorials online and try those commonly used commands in terminals. For example, it is recommended to go over chapter 1-3 of this tutorial.
Robot Operating System (ROS) is a Linux software library specifically designed for programming on robots. It has some features of OS, but is not actually an independent OS. With ROS, people do not need to worry about low-level communications and keep reinventing the wheel. On top of ROS, developers all over the world can work on their own software packages, and contribute to ROS community. These packages are similar to those libraries that we “import” in Python.
A good way to learn ROS is to learn from ROS wiki, which provides official tutorials. In addition, there is a reference book A Gentle Introduction to ROS by Jason M. O’Kane (free online), which introduces useful design ideas behind ROS. Note that examples in this book and some tutorials on ROS wiki are written in C++. Please focus on high-level design ideas and rospy library only (not roscpp), since we will use Python (instead of C++) in this class.
For Python, basically you need to have a rough idea about data structures, operators, flow control, etc. There are also many good tutorials online. For example, the tutorial on W3Schools. Going through the first 20 sections (until Python Functions) would be sufficient for this class.
Git is a version control tool and GitHub is a website (or company) that offers Git-based version control service. It’s good to learn Git in the sense that you can better manage your code. With Git, you can see all your change history, and have backups of each version. Many ROS packages that we are going to use in this course are hosted on GitHub. However, it’s not strictly required in this class. Going through chapter 1-5 of this tutorial might be helpful.
For Virtual Machine, there are mainly two kinds of software available online. One is VMware and the other is VirtualBox. The former has better utilization of GPU and hence supports better graphics, but it is not free of charge. The good news is that in recent years VMware has released a free “Player” version for individual users, which we will discuss later. On the other hand, VirtualBox is totally open source (free) for all platforms (Windows, Mac, Linux). However, it does not perform well in heavy simulation tasks in Gazebo. (Gazebo is a simulator that we are going to use throughout the course, together with ROS.)
Please familiarize yourself with the above concepts/tools, if they are new to you.
In the following, we will go through some basic steps to get our development environment ready.
Virtual Machine
If you have a Linux laptop, or you can dual boot with Linux operating system, that’s great! This is the best way to work on robots. (Please be careful about dual boot, since you have to take potential risks. We recommend using VMware instead.)
If you have a Windows laptop, please go for VMware Workstation Player. Note that this version 15.5 or 16 should be free.
If you have a Mac computer, please go to VMware Fusion webpage, register under “Get a Free Personal Use License” tab and download VMware Fusion Player using a free personal license. If in case you have a new Mac computer of M1/M2 architecture, please contact with the TAs to provide a VMware file to use.
Install Linux
Once you have your VMware installed, let’s create a new VM and install Ubuntu 16.04.
Download Ubuntu 16.04 disc image from official website (64-bit PC Desktop).
In VMware, create a new VM.
Typical configuration
Choose the disc image you download
Enter some information about this VM
Again, enter name
Please allocate at least 30GB (preferred 50GB or more)
Store virtual disk as a single file
Customize Hardware: Please allocate more memory and CPU processors for better performance
Finish
Great. Now you have a (virtual) Linux computer. Take your time and play with it!
Note that the disk size 30GB/50GB will not be allocated instantly, but will grow gradually as you add more stuff.
Install ROS
Once you are familiar with Linux, you can start installing ROS. In general, we need to follow ROS installation tutorial. Main steps are
Setup sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
Setup your keys
sudo apt install curl # if you haven't already installed curl curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
Update package index
sudo apt-get update
Install ROS desktop full
sudo apt-get install ros-kinetic-desktop-full
Environment setup
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc source ~/.bashrc
Install more dependencies
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
Initialize rosdep
sudo apt install python-rosdep # if you haven't already installed rosdep sudo rosdep init rosdep update --include-eol-distros
Learn from ROS Tutorials
Once you have ROS Kinetic installed, we provide the tutorial for ROS. You can also follow the tutorials on ROS wiki and rospy documentation.
Have fun!