Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This is our Capstone project repo for the final project of the Udacity Self-Driving Car Nanodegree. The goal of this project is to enable a car to drive itself around a controlled track that contains traffic lights that will be recognized and responded to.


We implement speed and steering using a PID controller with angular velocity as the goal. This is all implemented in

# If Positive difference throttle = nonzero, brake = 0
        # Else throttle = 0, brake = nonzero
        if(del_vel > 0) and (current_velocity < target_velocity):
            throttle = self.throttle_limit*(1.0 - (current_velocity/target_velocity))
            brake = 0
            throttle = 0
            brake = torque

Waypoint Updater

The waypoint_updater finds next waypoints from the closest waypoint based on the current position and the orientation of the vehicle. It then generates the final_waypoints with the velocity as defined by the launch file.

If the traffic_waypoint is published, waypoint_updater will generate a smooth deceleration velocity for the final_waypoints using a spline. In order to prevent deceleration taking too long, a parameter MAX_BRAKE_DISTANCE is defined. We only start to decelerate if the distance between current location and the stopping waypoint is less than MAX_BRAKE_DISTANCE.

Waypoint Loader

In order to save bandwidth, waypoint_loader only publish base_waypoints at rate of 1 hertz, and stop publishing after 5 seconds.

Traffic Sign Detection

We trained machine learning models to detect traffic lights in images in order to detect when we were coming up against a traffic light so that we could publish this information on a ROS node.

Traffic Sign Classification

The traffic sign classifier is based on Squeezenets that have seen a lot of success for the object detection problem. The advantage of using Squeezenet over other networks is that it provides AlexNet level accuracy with 50 times fewer parameters. The images have been preprocessed and resized to the size 300x300 for giving it input to the network. For the model to be effective in this scenario the hyperparameters have to be initialized intuitively.

For instance our number of classes is set to 3 (excluding no light: Red, Green and Yellow.) We set our learning rate to be 1e-4 and the number of epochs at 2000. Lastly we handle the data in batch sizes of 16.


  • Be sure that your workstation is running Ubuntu 16.04 Xenial Xerus or Ubuntu 14.04 Trusty Tahir. Ubuntu downloads can be found here.

  • If using a Virtual Machine to install Ubuntu, use the following configuration as minimum:

    • 2 CPU
    • 2 GB system memory
    • 25 GB of free hard drive space

    The Udacity provided virtual machine has ROS and Dataspeed DBW already installed, so you can skip the next two steps if you are using this.

  • Follow these instructions to install ROS

  • Dataspeed DBW

  • Download the Udacity Simulator.


  1. Clone the project repository
git clone
  1. Install python dependencies
cd Capstone
pip install -r requirements.txt
  1. Make and run styx
cd ros
source devel/
roslaunch launch/styx.launch
  1. Run the simulator

Real world testing

  1. Download training bag that was recorded on the Udacity self-driving car
  2. Unzip the file
  1. Play the bag file
rosbag play -l traffic_light_bag_files/loop_with_traffic_light.bag
  1. Launch your project in site mode
cd Capstone/ros
roslaunch launch/site.launch


name email username
David Awad @davidawad
Da Yang @day
Ashish Rana @mr.jatt
Michael Tien @mtien888
Naveed Ahmed @nahmed


This is the final project for the self driving car engineering program for team notable







No releases published


No packages published

Contributors 4