Skip to content

Desktop application that uses machine learning to teach an RC car to drive autonomously.

Notifications You must be signed in to change notification settings

77abe77/NeuralNetworkRCCarDesktop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Neural Network RC Car (Desktop Code)

This program works together with the NeuralNetworkRCCar iPhone application

External Dependencies

+ OpenCV 2+ + numpy + pygame

USAGE

Make the python file executable

chmod +x nnrccar.py

Run the program

``` ./nnrccar ```

Option 1: Collecting Training Data

Selecting option one will set up two concurrent processes. One listening to keyboard input and one waiting for video frames.

  1. Place the iPhone on the RC Car.
  2. Press a directional key to start streaming and recording.
  3. Start driving the car around your assembled path.
  4. To quit the program press Q (Upon quiting the program will save a txt file of direction keys mapped to raw grayscale pixel data AKA this is your training set)
Time to Train the Neural Network
  1. Open MATLAB or OCTAVE
  2. Navigate to NeuralNetworkServer/src/
  3. Run getTrainingData.m (This script loads direction input into an X vector and pixel data into y vector and saves it into a .mat file)
  4. Navigate to NeuralNetworkServer/src/NeuralNetwork/
  5. Run ex4.m (This code is a modification of project 4 of the online Stanford Machine Class. It runs a backpropogation algorithm to train a 3 layer neural network.)
  6. Navigate back to NeuralNetworkServer/src/
  7. Run prepareData.m (This will load the trained weights to a txt file for them to be sent to the iPhone)

About

Desktop application that uses machine learning to teach an RC car to drive autonomously.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published