Skip to content

Simpler version of donkey self driving car

License

Notifications You must be signed in to change notification settings

TheFebrin/donkey_lite

 
 

Repository files navigation

Donkey car lite

Simpler version of donkey self driving car

Table of contents

General info

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.

Setup Remote Access

To set up Raspberry Pi look here.

Connect Raspberry Pi to WiFi

Show instructions
  1. Check for available WiFi on your Raspberry Pi:

    $ sudo iwlist wlan0 scan |more
  2. 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, then ctr + x to save)

    $ sudo nano -w /etc/wpa_supplicant/wpa_supplicant.conf
  3. 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.

Connect your PC to Raspberry Pi using SSH

Show instructions
  1. Make sure SSH and VNC is enabled. If not go to sudo raspi-config then Interfacing Options.

  2. Connect your PC to the same WiFi network.

  3. Get your Raspberry Pi ip adress. ifconfig or use IP Scanner.

  4. Connect your PC to Raspberry using for e.g. PuTTY (only command line) or VNC Viewer (full preview).

Setup Remote File Access

Show instructions
  1. 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
  2. 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
  3. Create samba password.

    $ sudo smbpasswd -a pi
  4. Restart samba server.

    $ sudo service smbd restart
  5. 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.

Install USB Camera

Show instructions
  1. 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.

  2. Run raspivid -f in terminal to see if it works.

  3. You might also use cheese if you want.

    $ sudo apt-get install cheese -y

    (It didn't work for me, tho.)

  4. 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()

Functionality

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

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.

Miscellaneous

  • To build the CPP module run python setup.py build_ext --inplace.

  • To check RPi temperature type vcgencmd measure_temp

Screenshots

  • Self driving

    GIF

Technologies

Status

Project is: just_started,

Inspiration

Donkey car repo: https://github.com/autorope/donkeycar

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 64.5%
  • JavaScript 18.6%
  • Python 14.5%
  • HTML 1.6%
  • CSS 0.8%