Simpler version of donkey self driving car
Donkeycar is minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions.
We use Raspberry Pi 3 and the STM32 board a.k.a Blue Pill to communicate with car.
To set up Raspberry Pi look here.
Show instructions
-
Check for available WiFi on your Raspberry Pi:
$ sudo iwlist wlan0 scan |more
-
Input the ESSID and password into the configuration file.
$ sudo wpa_passphrase "login" "password"
Append it to configuration file.
$ sudo wpa_passphrase "login" "password" | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf
Go to
wpa_supplicant.conf
file and delete non hashed password. (ctr + k
to cut line, thenctr + x
to save)$ sudo nano -w /etc/wpa_supplicant/wpa_supplicant.conf
-
Reconfigure and connect to a new network.
To check connection.
$ ifconfig wlan0
To reconfigure connection.
$ sudo wpa_cli -i wlan0
You should get
OK
output.Now if you check connection again there will be information about your network.
Show instructions
-
Make sure SSH and VNC is enabled. If not go to
sudo raspi-config
thenInterfacing Options
. -
Connect your PC to the same WiFi network.
-
Get your Raspberry Pi ip adress.
ifconfig
or use IP Scanner. -
Connect your PC to Raspberry using for e.g. PuTTY (only command line) or VNC Viewer (full preview).
Show instructions
-
Install Samba File Server on Raspberry Pi.
$ sudo apt-get install samba samba-common-bin -y
$ sudo rm /etc/samba/smb.conf
$ sudo nano /etc/samba/smb.conf
-
Paste in the following lines into the nano editor.
[global] netbios name = Pi server string = The PiCar File System workgroup = WORKGROUP [HOMEPI] path = /home/pi comment = No comment browsable = yes writable = Yes create mask = 0777 directory mask = 0777 public = no
-
Create samba password.
$ sudo smbpasswd -a pi
-
Restart samba server.
$ sudo service smbd restart
-
Go to your PC (Windows), open
cmd
and type:C:\Users\My_user_name>net use r: \\your_raspberry_ip\homepi
dir r:
to check directory
r:
to switch to Pi your disk
From now on you are able to access your Pi's content in This PC
as it's an external drive.
For Mac users check this.
Show instructions
-
To enable video preview using VNC, open the VNC Server dialog (top bar on the RPi), navigate to Menu > Options > Troubleshooting, and select
Enable direct capture mode
. -
Run
raspivid -f
in terminal to see if it works. -
You might also use cheese if you want.
$ sudo apt-get install cheese -y
(It didn't work for me, tho.)
-
Simple python scipt worked the best for me.
from picamera import PiCamera from time import sleep camera = PiCamera() camera.rotation = 180 camera.start_preview(alpha=200) sleep(5) camera.stop_preview()
donkey_lite/camera
-
camera_preview.py
- Shows X second of video at given transparency
-
record_video.py
- Records 5 seconds video
-
take_picture.py
-
web_camera.py
- You can watch the camera stream at http://172.16.0.13:8887/status
- Now also saves every frame recorded
donkey_lite/car_modes
- recording_car.py
- simple_autonomous_car.py
- wall_bouncing_car.py
donkey_lite/drive_using_keyboard
- Allows you to drive using your keybord.
Uses pygame window to render buttons and listen to keys.
donkey_lite/learning_models
- Image preprocessing
- Self-driving model training
- Saved models
donkey_lite/parts
- Used to communicate with car's hardware.
-
To build the CPP module run
python setup.py build_ext --inplace
. -
To check RPi temperature type
vcgencmd measure_temp
- Python - version 3.7.3
- donkeycar
- pytorch - Tutorial
- cv2 - Common issue
Project is: just_started,
Donkey car repo: https://github.com/autorope/donkeycar