Self Driving Car Nanodegree Capstone project

Introduction

This read me forms the basis of the submission report for team FlyingDragons.

The team consists of the following team members

Name Email address
Wilfred Henry physicsteacher13@gmail.com
Lybron Sobers lybronsobers@icloud.com
Mostafa Mansour mostafa.e.mansour@gmail.com
Jose Antonio de la Fuente delafu@gmail.com
George Haigh georgehaigh@hotmail.com
Fabrizio Frigeni ffrige@hotmail.com

Waypoint Updater

We coded the waypoint updater in two phases like described in the lessons. First we implemented the partial updater and then the full updater.

The updater suscribes to the topics /traffic_waypoint, /current_pose, /base_waypoint and /ostacle_waypoint. It needs all the information to publish the next waypoints.

It works at 50 Hertz but we tried at lower rates and it works too.

DBW Node

TODO

Traffic Light Detector

The traffic light detector was based on the starter code from the project walkthrough.

A summary of the functionality follows:

The coordinates of the Traffic Lights are received by subscribing to the '/vehicle/traffic_lights' topic. This also includes the status of each light which was used in order to test the rest of the system. The coordinates of the stop lines is returned from the yaml configuration file.

As the cooridinates of the pose of the lights is static, they are only read on the traffic_lights topic to try to limit the latency that was experienced during development.

A KDTree of the base waypoints is created by subscribing to the "base_waypoints" message. Once the coordinates of the traffic lights and stop lines are known, the nearest waypoint to these is obtained by querying the KDTree containing the base waypoints. Again these activities are only done once to minimised latency.

The vehicle pose is received on the /current_pose topic.

A loop is run at a process the traffic lights. This involves finding the nearest waypoint to the cars position, and finding the closest stop line and traffic light in from of the vehicle, by using the waypoint indicies of these to judge the distance.

The state and index of the closest traffic light is then published on the '/traffic_waypoint' topic

Traffic Light Classifier

#TODO

Project Issues

The team experienced issues with the Udacity Simulator during this project. Enabling the camera results in significant lag, which causes the PID to be unable to maintain control of the steering. This appears to be a known issue, this discussions on slack in online. (udacity/sdc-issue-reports#1217)

The following attempts were made to recify this:

  • Running the simulator on an additional PC, and connecting via ports
  • Using the minimal graphic quality settings
  • Modifying the server.py
  • Adjusting the VM memory and CPU setting to give more processing power to the VM, and alternately the host
  • Modifying the tcp buffer size using sysctl.configuration
  • Unsubscribing the the image_color topic when not near a traffic light

None of these were particularly useful, the only real solution was to disable the camera when not in use (i.e when between traffic signs)

Reference

For completeness, the original Readme follows below this point for refernce purposes.

This is the project repo for the final project of the Udacity Self-Driving Car Nanodegree: Programming a Real Self-Driving Car. For more information about the project, see the project introduction here.

Please use one of the two installation options, either native or docker installation.

Native Installation

  • 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.

Docker Installation

Install Docker

Build the docker container

docker build . -t capstone

Run the docker file

docker run -p 4567:4567 -v $PWD:/capstone -v /tmp/log:/root/.ros/ --rm -it capstone

Port Forwarding

To set up port forwarding, please refer to the instructions from term 2

Usage

  1. Clone the project repository
git clone https://github.com/udacity/CarND-Capstone.git
  1. Install python dependencies
cd CarND-Capstone
pip install -r requirements.txt
  1. Make and run styx
cd ros
catkin_make
source devel/setup.sh
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
unzip traffic_light_bag_file.zip
  1. Play the bag file
rosbag play -l traffic_light_bag_file/traffic_light_training.bag
  1. Launch your project in site mode
cd CarND-Capstone/ros
roslaunch launch/site.launch
  1. Confirm that traffic light detection works on real life images