This page was created to support lectures on ROS in my Embedded Systems courses. Last updated in August 2020.
Getting Started with the Raspberry PI
- Raspberry PI (4B, or 3B, or 3B+)
- Micro SD card, larger than 9GB. Image is 8.58 GB.
- SD card reader to format and flash images to the SD Card.
- USB cable to power the Raspi.
- Ethernet Cable to connect Raspi to host PC.
- Assuming a Windows host computer. Everything can certainly be done on Linux and Mac, however, these instructions reflect what I had to do on Windows.
- A USB Webcam (for the ECE642 Image Processing experiment)
- Headless setup. Tutorials often require working with the Raspi as a computer by plugging an HDMI monitor, Keyboard, and Mouse to the Raspi. You may still do this and it might add convenience. The instructions here will walk you through a “headless setup” (no monitor) where we will do everything through a remote SSH connection.
Initial Setup Guide
- Highly Recommend this video which illustrates many of these steps.
- Download pre-made image at this link. This saves you a substantial time on setup work.
- Flash the image onto your SD Card using Win32DiskImager. This is done on the host computer using an SD Card Reader.
- Insert the imaged SD card into the Raspi, and power it up using the USB cable.
- We need to establish an SSH connection to the Raspi through its Ethernet port.
- You may plug it into your home router (the same one your host machine is connected to).
- You may connect it directly to your working Laptop, then set up Windows to remote connection by going to: Control Panel → Network and Internet -> Network and Sharing Center → Change Adapter Settings → Right Click “Wifi” → Properties → “Sharing” tab → Check “Allow other network users…” → OK . This will make your PC be a host for the Raspi and give it an IP address.
- To find out the IP address of the PI, you can use “Advanced IP Scanner” to search for it.
- Use PuTTY to establish an SSH connection to the PI.
- Skip to the command line commands below
- For graphical features, we need to set up X11 Forwarding:
- We will need Xming, which is an “X11 Server”. This will allow the Raspi to draw graphics on your host PC by sending commands through PuTTY. This will enable things like loading the Raspi graphical desktop (if you’re tired of command line for example), visualize ROS graphical output, and others.
- Configure PuTTY to “Enable X11 Forwarding”, see these instructions.
At first log in to the Raspi:
*Advanced -> Expand Filesystem
*Enable Camera -> Yes
*Advanced Options -> SSH -> Yes
* Finish -> Reboot Now
From the many books I considered to get started, this has been my favorite as a first introduction: “A Gentle Introduction to ROS” by Jason O’Kane. Free PDF is available at the link, as well as a useful zip file of examples. The brook presents and explains concepts in “the right order” from my perspective.