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.
my_cv.py
: holds most of the OpenCV2 files that manipulate the image and ultimately creates the lineslines.py
: runs the functions set up inmy_cv.py
defined as one overall functionformula.py
: creates a dataset from the lines of each simulation image, with the columns asleft_line_y_int
,left_line_slope
,left_line_angle
,right_line_y_int
,right_line_slope
,right_line_angle
,steering
, andthrottle
formula_rho_theta.py
: creates a dataset from the lines of each simulation image, with the columns asleft_line_rho
,left_line_theta
,right_line_rho
,right_line_theta
,steering
, andthrottle
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.