Even if you don't have an RC car, you can start here and follow the rest of the project by just substituting the RC car with the simulator!
It's also a good way to get your feet wet with this kind of a project without building an actual RC. If it turns out you like it, you can always go back to the beginning and build an actual platform.
And if you're thinking: boo, why use a simulator when we have a real RC car!, remember, even Tesla uses a simulator.
It is true that, as Andrej Karpathy says in the video above: there is no substitute for real data. But that being said, the simulator gives us a chance to rapidly prototype and even test multiple models at once. It also gives us an environment where we don't have to worry about the physical RC crashing into something or hurting someone. Also, if you wanted to use reinforcement learning, would you really be willing to let your RC smash into the wall for episodes and episodes until it learns basic stuff?
Also, if you've got the time, do take a look at the video above (Tesla Autonomy Day stream), it's full of insights on how they do stuff that actually drives on actual roads.
Download and unzip the simulator for your platform from the DonkeyCar GitHub release page
Place the simulator into your projects folder (where you cloned the Donkey repo)
cd ~/projects git clone https://github.com/tawnkramer/gym-donkeycar conda activate donkey pip install -e gym-donkeycar
Create a new Donkey application for your simulator:
donkey createcar --path ~/mysim cd ~/mysim
Edit the myconfig.py file inside the application folder you just created (mysim):
# Enables the Donkey Gym simulator wrapper DONKEY_GYM = True DONKEY_SIM_PATH = "/home/wherever/your/projects/are/DonkeySimFolder/DonkeySim.exe" # Choose the track you want to run, you can change this later DONKEY_GYM_ENV_NAME = "donkey-generated-track-v0"
Download this test dataset that contains data of a car recovering from dropping out from the track and some standard driving data and put it in your data folder inside your application folder (/mysim/data/)
Train your model by running
python manage.py train --model models/mymodel.h5
Test your model by running
python manage.py drive --model models/mymodel.h5
If you're using Linux, you can also pass the –js parameter and use your gamepad if it's mounted to /dev/js0
Download this big dataset that contains 16 different venues with tape lined tracks on concrete and tile (some are on carpet and cobblestones)
The dataset is big. And it contains a lot of small files, which means you should pay attention where you're extracting the files, since moving/copying them will take a long while since OS's don't like working with millions of small files.