This is my method to use the Donkey Car, derived from the autorope/donkey2.
-
Flash MicroSD card (16-32GB) using your favorite tool. balenaEtcher seems to be popular.
-
Configure wireless networking, in the /boot partition create wpa_supplicant.conf file containing:
country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="MyNetworkSSID"
psk="Pa55w0rd1234"
}- Enable SSH by creating an empty file in /boot named "ssh"
- First boot, ssh to your Pi, user:pi password:raspberry (Need more newbie help here?)
- Run raspi-config as super user
sudo raspi-config- Change hostname
- Change password
- Interface Options
- Enable Camera
- Enable I2C
- Advanced: Expand Partition
- Finish & Reboot
sudo shutdown -r now- Package Updates
sudo apt update
sudo apt upgrade- Install Prerequisites (possibly more than required??)
sudo apt-get install git
sudo apt-get install python3 python3-pip python3-virtualenv python3-dev virtualenv
sudo apt-get install build-essential gfortran libhdf5-devRun these commands to setup your donkey car app on your car's raspberry pi.
-
Create and activate your virtual environment.
virtualenv env --python=python3 source env/bin/activate -
Dowload and install the dependencies for this car template. (This can take a LONG time . . . . )
git clone https://github.com/autorope/donkey2.git cd donkey2 pip install -r drive_requirements.txt -
Activate virtual environment on login. Add this as the last line of your .bashrc file in your home directory
source env/bin/activateWe will be using a Arduino Pro Micro to emulate the PS3 joystick. This will allow the use of the RC transmitter that came with your car during training. More details to come.
- [ArduinoJoystickLibrary]https://github.com/MHeironimus/ArduinoJoystickLibrary
- [DonkeyPart PS3/PS4 Game Controller]https://github.com/autorope/donkeypart_ps3_controller
- Don't worry about any of the Bluetooth stuff, not using it.
- Steering will be on Axis 0 and Throttle on Axis 4
- We will be editing drive.py and conf.py
- SSH to your Pi:
- Run the drive script.
python drive.py
Here are the steps to train an autopilot on your computer after you've transfered the the tubs from your car's pi to your laptop.
-
Create and activate your virtual environment.
virtualenv env --python=python3 source env/bin/activate -
Dowload and install the dependencies for this car template.
git clone https://github.com/autorope/donkey2.git cd donkey2 pip install -r train_requirements.txt -
Train an autopilot
python train.py /path/to/folder/with/tubs/* -
Planning to work up some notes on using Docker Tensorflow environment for training. Stay Tuned.