Skip to content

1. Work Environment Setup

Joseph Saliba edited this page Oct 14, 2023 · 16 revisions

To setup your computer to be able to write and run code for the Rover, follow the following steps exactly. If you get stuck, reach out to the team on Discord! The virtual machine option is slower and does not work with external devices like the joystick or sensors, but is the "safer" option. If you can, we recommend doing a dual-boot, but a virtual machine can do 90% of what a dual boot can.

Ubuntu 20.04 Setup

NOTE: this will require a 64-bit computer. If you do not have one, reach out to a lead to explore options. Also, If you run into problems, Google has plenty of resources for figuring them out...

For Windows Virtual Machine Setup (slower, does not work with external devices like the joystick or sensors, safer option)

  1. Download the Ubuntu 20.04 image file from here
  2. Install VirtualBox for your computer
  3. Once installed and open, click "New" and set up your virtual machine (give it at least 50GB!)
  4. When your virtual machine is setup, run your virtual machine and start the Ubuntu installation!
  5. Make sure you select Minimal Installation when prompted! Otherwise there can be problems with graphics drivers, libraries, etc. Try to keep additional software it wants you to install to a bare minimum.

For Mac Virtual Machine Setup (M1/M2 chip)

  1. Download the Ubuntu 20.04 image file from here and choose 64-bit ARM desktop image.
  2. Install UTM for your computer
  3. Once installed and open, click "New" and set up your virtual machine (Make sure you give it at least 50GB!) 3.1. Choose virtualize
    3.2. Then choose other for operating system and upload the image disk of ubuntu you downloaded. Then keep clicking on continue
    3.3. Run the vm and choose install ubuntu.Make sure to choose minimal installation.
    3.4. when it is installed it will ask you to restart. click on the third icon from the right at the tog, toggle over CD/DVD (iso) and choose eject. Then restart your vm.

For Dual-boot Setup (riskier than a virtual machine, does not work for Apple computers, faster)

  1. Download the Ubuntu 20.04 image file from here
  2. Flash the image file to an external USB drive (this will erase all data on the drive!). You can follow a tutorial (Windows)
  3. Disable bitlocker if you have it enabled.
  4. Disable secure boot from the BIOS.
  5. Partition your hard drive to make a drive for Ubuntu (you shouldn't need more than 50 GB, and you can always increase this size later)
  6. Once the USB drive has been flashed, restart your computer and enter the BIOS. (how to do this depends on computer brand, but it is easy to find out how on Google)
  7. Once in the BIOS, select the option to boot from the USB device.
  8. When prompted, select the drive that you just partitioned to install Ubuntu to.
  9. Make sure you select Minimal Installation when prompted! Otherwise there can be problems with graphics drivers, libraries, etc. Try to keep additional software it wants you to install to a bare minimum.

ROS Setup

Run the commands below to install ROS Noetic on Ubuntu OS.

1. Setup your sources.list

Setup your computer to accept software from packages.ros.org.

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

2. Set up your keys

Import key to trust the ROS installation repository

sudo apt install curl
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

3. Installation

First, make sure your Debian package index is up-to-date:

sudo apt update

Then:

sudo apt install ros-noetic-desktop-full

4. Environment setup

Run the below command to automatically source the setup script whenever you open a terminal:

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

5. Dependencies for building packages

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. To install some useful dependencies for building ROS packages, run:

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

6. Initialize rosdep

Before you can use many ROS tools, 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. If you have not yet installed rosdep, do so as follows.

sudo apt install python3-rosdep

With the following, you can initialize rosdep.

sudo rosdep init
rosdep update

7. Test ROS to verify installation

Close all terminals, open a new one, and run

roscore

You should see an output similar to this printed on the terminal. If you do, ROS installation is successful.

If you don't, and have trouble understanding why, reach out!

Install Python

Run the commands below to install python.

sudo apt-get update
sudo apt install python3.8

Install Catkin

Catkin is the build tool we use for ROS. First, add ros repo.

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

Then add the key of the repo.

wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

Then install catkin

sudo apt-get update
sudo apt-get install python3-catkin-tools

Install Visual Studio Code

VSCode for all machines except Mac M1/M2

First install snapd, a package manager tool.

sudo apt update
sudo apt install snapd

Then use snapd to install code

sudo snap install --classic code

VSC is the code editor we recommend you to use.

VSCode for Mac M1/M2 (arm arch)

Go to VSCode Download Page And press download on the .deb Arm64 button as shown below. Run the installed file and press install. image

Install git

Git is a version control system used for collaboration in software-based workspaces.

sudo apt-get update
sudo apt-get install git