top of page

Setting Up ROS on Mac or Windows

This tutorial will show you how to install VirtualBox, Ubuntu Linux, and ROS Melodic to get ready for robotics software development for the Columbia University Robotics Club. The tutorial doesn't assume you have background knowledge. Some familiarity with the Linux command line is recommended.  

Step 1 - Installing VirtualBox

image13.png
image7.png
  • Allocate a generous amount of RAM to the virtual machine. I’d recommend ¼ of your computer’s RAM. For instance, if you have 16GB of RAM in your laptop, then allocate 4 GB (4096 MB) memory to the virtual machine. Then, click “Create.” Choose a VDI (VirtualBox Disk Image) and ensure it is Dynamically Allocated. Allocate at least 10GB to this image and then click “Create.”

image6.png
  • Allocate a generous amount of RAM to the virtual machine. I’d recommend ¼ of your computer’s RAM. For instance, if you have 16GB of RAM in your laptop, then allocate 4 GB (4096 MB) memory to the virtual machine. Then, click “Create.” Choose a VDI (VirtualBox Disk Image) and ensure it is Dynamically Allocated. Allocate at least 10GB to this image and then click “Create.”

  • ​Click “New” to create a new virtual machine.

  • Name your machine anything you want, choose “Linux” for the operating system and “Ubuntu (64-bit)” for the boot version. Then, click “Continue.”

Screen Shot 2020-09-24 at 10.18.37 PM.pn

Step 2 - Creating a Ubuntu Virtual Machine

  • Create a new virtual hard disk. Click “Continue.”

image15.png
image5.png
image4.png
  • Download a 64-Bit Ubuntu Desktop disk image from here. We recommend you download the LTS version. Note the location of the downloaded .iso file.

image12.png
  • In the menu, click “Start” to start your machine.

image9.png
  • Press the folder icon to select your downloaded .iso Ubuntu image. Then, click “Start.”

image2.png
image8.png
  • Give it some time, then you should see Ubuntu starting up. From within the virtual machine, select “Install Ubuntu.” From here, it doesn’t matter which preferences you choose. If you’d like to use this virtual machine for other projects, we recommend performing a “Normal Installation.” Otherwise, a “Minimal Installation” will improve performance as fewer disk space will be used for applications. Finally, hit “Erase disk and install Ubuntu.”

image1.png
image3.png
  • Wait as the operating system installs. When it’s finished, restart your machine and press “Enter.” If you encounter a black screen, simply press Cmd+R (Ctrl+R on Windows) to reset the machine. You should be booted into the home screen.

image11.png
image10.png
  • Navigate to the terminal and run the following three commands to allow you to install guest additions (which enable you to interact between your virtual machine and computer).

sudo apt-get update

sudo apt-get install build-essential gcc make perl dkms

reboot

  • After rebooting, under the Devices menu in the toolbar, click “Insert Guest Additions CD Image.” When prompted, click “Run.” Type in your password. You will then have guest additions installed, which will do things like resize your virtual screen when you resize your window. It’s minor, but will prove really helpful later on.

image17.png

Step 3 - Installing ROS Melodic

  • [Note: the following has been taken from here. If you have any issues, consult that source first!] Setup your computer to accept software from packages.ros.org by running the following in the Terminal.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

  • Set up your public key via the following Terminal command.

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

If you experience issues connecting to the keyserver, you can try substituting hkp://pgp.mit.edu:80 for hkp://keyserver.ubuntu.com:80 in the previous command.

  • Make sure your Debian package index is up-to-date by running the following command.

sudo apt update

  • Install all necessary ROS libraries via the following command. When prompted, press “Y” to continue installation.

sudo apt install ros-melodic-desktop-full

  • Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

sudo rosdep init

rosdep update

  • It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc

  • Up to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command. To install this tool and other dependencies for building ROS packages, run:

sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential

Congrats, you are done! 

This tutorial is developed by Anthony Krivonos, compiled by Neil Nie. If you have any questions, please email curc@columbia.edu. (C) All rights reserved. 

bottom of page