Building an Autonomous Car using a 1/10th Scale RC Car — Part 1

Eric Maggard
5 min readSep 10, 2017

--

I have two robotic bases that have mapped my house and navigate my house autonomously. I want to apply the learning from the projects in Udacity’s Autonomous Car Nanodegree to a mobile base that can navigate outside. Therefore, I am starting to purchase parts and setting up processing boards for this project.

Project Goal: The goal of this project is to build an autonomous base that can navigate the sidewalks of my subdivision. It will use GPS, LIDAR, and other sensors to navigate to GPS way points, avoid obstacles, and return to the start position.

This is the list of components that I am planning on using:

  • Traxxas Slash 1/10 scale RC Truck
  • Traxxas 7600mAh LiPo Battery
  • Option 1: Raspberry Pi3 w/Movidius Neural Compute Stick
  • Option 2: Nvidia Jetson TX-1
  • Arduino Mega
  • Logitech C920 Webcam
  • XV-11 Neato LIDAR with range of 5m
  • LIDAR Lite 1D with range of 40m
  • Adafruit 10DOF sensor
  • Adafruit GPS module w/antenna

Inital Setup

I am going to be using ROS Kinetic as the controlling software and am initially going to work on option 1: Raspberry Pi3. I have a Jetson TX-1 board currently on one of my home robots and might use that as option 2.

Install OS

I downloaded and installed the Ubuntu MATE version for the Raspberry Pi3. I selected this OS since I have been using Ubuntu for the Desktop and for armhf for the last couple of years and am most familiar with it. The OS can be installed from here: https://ubuntu-mate.org/raspberry-pi/

Install ROS Kinetic

I selected ROS Kinetic since I have it setup on my desktop and my other two home robots. I leveraged much of the install instructions from the ROS Wiki: http://wiki.ros.org/kinetic/Installation/Ubuntu

I have installed ROS on Desktop Ubuntu systems, Jetson TX-1, UDOO Quad, Raspberry Pi3, and Beaglebone Black. The only issue that I have had with any of the installations is setting up the keys. I have documented three different ways to install the keys.

Note: ROS Kinetic only supports Ubuntu 15.10, Ubuntu 16.04, and Debian 8. ROS Kinetic and Ubuntu 16 will be supported through April 2021, so upgrading for a number of years will not be an issue.

Setting up Repositories

Repositories need to be configured to allow downloads from “Restricted”, “Universe”, and “Multiverse”. This Ubuntu help document is a good guide: https://help.ubuntu.com/community/Repositories/Ubuntu

Setting up sources.list: You then need to setup sources.list to accept software from packages.ros.org. Enter the following command into a Terminal window:

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

Setting up Keys

Enter the following to setup keys:

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

If that fails, then try entering:

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

If you get an error: gpg: no valid OpenPGP data found, then enter the following line:

sudo -E apt-key adv --keyserver hkp://pool.sks-keyservers.net --rec-key 0xB01FA116

Installing ROS

Now we can setup ROS and the packages we need. There are several different configurations to setup ROS. Since we don’t need the visualization supplied by RViz and some of the other simulators on the robot, we will load the base version and install just the packages we need.

Before installing packages, we need to make sure the packages are up to date. Enter the following into the Terminal:

sudo apt-get update

Installing base: Now to setup the base ROS Kinetic package:

sudo apt-get install ros-kinetic-ros-base

Installing Packages: The following packages will be installed for communication, navigation, and other processes. Enter each of the following lines in the Terminal:

sudo apt-get install ros-kinetic-nav-core ros-kinetic-nav2d 
sudo apt-get install ros-kinetic-rosserial-python ros-kinetic-rosserial-server
sudo apt-get install ros-kinetic-tf2 ros-kinetic-tf2-ros
sudo apt-get install ros-kinetic-amcl ros-kinetic-global-planner ros-kinetic-costmap-2d
sudo apt-get install ros-kinetic-move-base
sudo apt-get install ros-kinetic-roslint
sudo apt-get install ros-kinetic-image-transport ros-kinetic-compressed-image-transport
sudo apt-get install ros-kinetic-camera-info-manager
sudo apt-get install ros-kinetic-hector-imu-tools ros-kinetic-hector-localization ros-kinetic-hector-map-tools ros-kinetic-hector-mapping ros-kinetic-hector-pose-estimation-core ros-kinetic-hector-slam
sudo apt-get install ros-kinetic-openslam-gmapping ros-kinetic-gmapping ros-kinetic-slam-gmapping

Initalize rosdep: Now you initialize rosdep before you can begin using ROS. To initialize, you enter the following in the Terminal:

sudo rosdep init
rosdep update

Environment Setup: To make it convenient to have the ROS environment loaded into the shell when a Terminal is opened, you can write the line to bash by running to following lines:

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

If you would like to install other packages, you can find them by entering the following line in the Terminal:

sudo apt-cache search ros-kinetic

Creating a ROS workspace

The final thing that we need to do is create a ROS workspace so we could start building our own packages, or modifying current ones. To create a workspace, we need to create a folder and then do an initial build. Enter the following lines in a Terminal window:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

After the catkin_make command, the build should have completed without error and there now should be a ‘build’ and ‘devel’ folder under the catkin_ws directory. Now we can create and modify ROS packages.

Test Installation

The final thing to do for this part is to test the installation. To do that, type ‘roscore’ into the Terminal window. ROS should start up and initiate the master process. This will be similar to the window show below:

If ROS doesn’t start up and gets an error, then close the Terminal window and reopen another one. This should initiate the ROS environment variables and allow ROS to start.

Part 2

In the next part of the project, I am going to go through setting up reading of the various sensors and building ROS publishers and listeners for each sensor. I will program those in Python and show how to interact with the necessary ROS message types.

--

--