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.
Name | Udacity account email |
---|---|
Mario Landry (Team Lead) | mario.landry AT gmail.com |
Rob Fitch | rob.m.fitch AT gmail.com |
Rafael Rivas | rafael.rivas.dev AT gmail.com |
Patrick Poon | patrickmpoon AT gmail.com |
The waypoint updater is responsible for calculating the next LOOKAHEAD_WPS (200) Waypoints and setting a target velocity for each. The default target velocity at each waypoint is set at system startup and recorded into the base waypoints. This velocity is used as a ceiling for the vehicle velocity and intentionally left unaltered by the waypoint updater. At each call to the waypoint updater, a subset of the base waypoint list is created of length LOOKAHEAD_WPS, starting with the calculated NEXT_WAYPOINT. The velocities of these waypoints are then set to allow smooth and safe deceleration for any obstacles the car encounters. To aid in this, the current vehicle velocity and maximum acceleration value are used to determine the distance required by the vehicle to safely stop. This value is recorded as the deceleration zone or decel_zone.
The waypoint updater subscribes to a list of obstacles as well as a waypoint for the next light. If either of these are populated, they indicate zones the car should not pass through. The traffic light waypoint, if present, is appended to the end of the list of obstacles. Each waypoint in the obstacle list is accompanied by a standoff distance, indicating how far before reaching the obstacle the car should attempt to stop. The standoff value is determined based on the subscription providing the obstacle.
For every waypoint in the obstacle list found to be within the respective deceleration zone plus standoff distance, a stopping gradient is calculated. The velocity at each final waypoint is the lowest value among these stopping gradients and the velocity already set for the waypoint.
-
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 team provided a virtual machine that 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
- ROS Kinetic if you have Ubuntu 16.04.
- ROS Indigo if you have Ubuntu 14.04.
-
- Use this option to install the SDK on a workstation that already has ROS installed: One Line SDK Install (binary)
-
Download the Udacity Simulator.
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
- Clone the project repository
git clone https://github.com/udacity/CarND-Capstone.git
- Install python dependencies
cd CarND-Capstone
pip install -r requirements.txt
- Make and run styx
cd ros
catkin_make
source devel/setup.sh
roslaunch launch/styx.launch
- Run the simulator
- Download training bag that was recorded on the Udacity self-driving car (a bag demonstraing the correct predictions in autonomous mode can be found here)
- Unzip the file
unzip traffic_light_bag_files.zip
- Play the bag file
rosbag play -l traffic_light_bag_files/loop_with_traffic_light.bag
- Launch your project in site mode
cd CarND-Capstone/ros
roslaunch launch/site.launch
- Confirm that traffic light detection works on real life images