This is an algorithm to predict the steering angle of a car from a Unity simulation. This simulation is based on a project called DonkeyCar in which teams create a RC car to autonomously drive. This is a virtual solution to this problem using Computer Vision. Dataset for training images can be found here: https://www.kaggle.com/niallmandal/car-data-from-a-unity-simulation
The github to the simulator used can be found here: https://github.com/tawnkramer/sdsandbox.
~10K images were captured on frame data, with the steering angle and throttle recorded in the actual name of each image.
Each image is unaltered, and is just pure pixel data.
1) my_cv.py
: holds most of the OpenCV2 files that manipulate the image and ultimately creates the lines
2) lines.py
: runs the functions set up in my_cv.py
defined as one overall function
3) formula.py
: creates a dataset from the lines of each simulation image, with the columns as left_line_y_int
,left_line_slope
,left_line_angle
,right_line_y_int
,right_line_slope
,right_line_angle
,steering
, and throttle
3) formula_rho_theta.py
: creates a dataset from the lines of each simulation image, with the columns as left_line_rho
,left_line_theta
,right_line_rho
,right_line_theta
,steering
, and throttle
The ρ function is a numpy version of this function:
The θ is calculated as so:
Note: raw_log is the name of the folder used where all of the images are proccessed. The folder "example images" is used purely to show what each image may look like.