This project implements the core functionality to autonomously drive a vehicle around a track. It includes traffic light detection (perception), waypoint updates (planning) and dbw 'drive by wire' operations (control). The code is tested against a simulator that mimics functionality on Carla, Udacity's self driving car!
The following system architecture diagram shows the ROS nodes and topics used in the project.
The /current_pose topic provides the vehicle's current position and the /base_waypoints provides a complete list of waypoints the car will be following.
The traffic light detection node takes in data from topics such as /image_color, /current_pose and /base_waypoints and publishes locations to stop for the red traffic lights to the /traffic_waypoint topic.
The waypoint updater node will update the target velocity property of each waypoint based on the traffic light and obstacle detection. This node will subscribe to the /base_waypoints , /current_pose , /obstacle_waypoint , and /traffic_waypoint topics, and publish a list of waypoints ahead of the car with target velocities to the /final_waypoints topic.
Finally we have a drive-by-wire (dbw) system to control. A DBW system has electronic control for throttle, brake, and steering. The dbw_node subscribes to the /current_velocity topic along with the /twist_cmd topic to receive target linear and angular velocities. Additionally, this node will subscribe to /vehicle/dbw_enabled, which indicates if the car is under dbw or driver control. This node will publish throttle, brake, and steering commands to the /vehicle/throttle_cmd, /vehicle/brake_cmd, and /vehicle/steering_cmd topics to control the vehicle at 50 Hz.
- Open the repo
cd /home/workspace cd CarND-Capstone
- Install the requirements
pip install -r requirements.txt
- Source setup.bash
cd ros
catkin_make
source devel/setup.sh
- Launch the project
roslaunch launch/styx.launch
The test drive video for the code repo shows the simulation vehicle autonomously drive around a track at a set speed of 18.6 mph (30 km/h) slowing down and coming to a complete stop at red lights.