Skip to content

Commit

Permalink
Merge pull request #29 from wroscoe/dev
Browse files Browse the repository at this point in the history
Add differential drive and update docs.
  • Loading branch information
wroscoe authored Feb 9, 2017
2 parents 1efcf96 + 45b4b81 commit e48ce77
Show file tree
Hide file tree
Showing 42 changed files with 1,200 additions and 634 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once you have built your car you can use it like this.

3. Go to `<your_pilot_server_ip>:8887` on your phone or computer to start driving your car.

Use the [demos](demos) to see how to record driving data, train autopilots and more.
Use the [scripts](scripts) for more tools to manipulate datasets and train autopilots.



Expand Down
34 changes: 0 additions & 34 deletions demos/drive_sim.py

This file was deleted.

19 changes: 0 additions & 19 deletions demos/serve_no_pilot.py

This file was deleted.

23 changes: 0 additions & 23 deletions demos/serve_pilot.py

This file was deleted.

18 changes: 0 additions & 18 deletions demos/train_download.py

This file was deleted.

35 changes: 0 additions & 35 deletions demos/train_generator.py

This file was deleted.

102 changes: 2 additions & 100 deletions docs/01-build_a_car.md
Original file line number Diff line number Diff line change
@@ -1,101 +1,3 @@
# Get Started
This doc will walk you through how to setup your donkey.


## Bill of Materials.
#### Required
* Raspberry Pi 3 B ($35)
* Raspberry Pi Camera ($15)
* Micro USB power adapter. ($9)
* USB Battery Pack ($15)
* USB Keyboard
* USB Mouse
* Monitor
* HDMI cable (to connect monitor to PI) ($7)
* Micro SD Card (campatible with Raspberry Pi) ($8)
* Servo Sheild ($15)
* RC CAR (($120-300))

#### Optional
* Xbox 360 Controller
* Xbox USB Adapter



## Setup
These instructions are based on [Geoff Boeing's post on setting up scientific python on a Raspberry Pi](http://geoffboeing.com/2016/03/scientific-python-raspberry-pi/).

#### Boot your Raspberry Pi
These instructions assume you're using Ubuntu operationg system. If you don't have Ubuntu, try using the NOOB method.

1. Download recent Disk image. I use Jessie.
2. Extract disk image from zip file.
3. Open Ubuntu's "Startup Disk Creator" application.
4. Insert micro usb disk via a usb adapter. This disk should show up in the Startup Disk Creator app.
5. Select your RPi .img file and click create disk.
6. Once the img has been created, take the SD card from your computer and put it in your RPi.
7. Connect your Monitor with your HDMI cable, your mouse and keyboard and then finally power up the RPi by plugging in the Micro USB power adaptor.


#### Install Basic Libraries
Since the RPi is not as powerful as a laptop, it can take a long time to install python packages (ie. numpy & PIL) using pip. Luckly Adafruit has precompiled these libraries into packages that can be installed via `apt-get`.

1. Open a terminal (Ctrl-Alt-t) and upgrade your system packages.

```
sudo apt-get update
sudo apt-get upgrade
```
2. Save These initial conditions.

```
dpkg -l > ~/Desktop/packages.list
pip freeze > ~/Desktop/pip-freeze-initial.list
```

3. Install the necessary libraries

```
sudo apt-get install xsel xclip libxml2-dev libxslt-dev libzmq-dev libspatialindex-dev virtualenv
```
4. Pandas & Jupyter Requirements
```
sudo apt-get install python3-lxml python3-h5py python3-numexpr python3-dateutil python3-tz python3-bs4 python3-xlrd python3-tables python3-sqlalchemy python3-xlsxwriter python3-httplib2 python3-zmq
```
5. Scientific Python
```
sudo apt-get install python3-numpy python3-matplotlib python3-scipy python3-pandas
```

#### Install your Camera
Follow the instructions [here](https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/).


1. Connect your camera to the RPi.
2. Enable your camera in the Menu > Preferences > Raspberry Pi Config
3. Restart your Pi. `sudo reboot`


#### Connect your servo sheild.

1. Assemble and test your servo shield with the instructions given by Adafruit.


#### Install Donkey


clone repo & create virtual env

```
mkdir code
cd code
git clone http://github.com/wroscoe/donkey.git
mkdir car
cd car
virtualenv --system-site-packages -p python3 env
source env/bin/activate
pip install -e ../donkey[pi]
```

# Build a donkey vehicle.

Anyone can build their own robocar that runs Donkey. Once you have the parts it will take ~4hrs to start driving. See the [detailed instructions](https://docs.google.com/document/d/11IPqZcDcLTd2mtYaR5ONpDxFgL9Y1nMNTDvEarST8Wk/edit).
14 changes: 13 additions & 1 deletion docs/02-start_driving.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ Now that you have built your car, you'll want to drive it.
sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'
```
3. Connect to your pi by running `ssh pi@<your_pi_ip_address>`
4. Run the `drive_pi.py` demo script
4. Activate your python virtual environment
```
cd donkey
source env/bin/activate
```
5. Start your drive script.
```
python demos/drive_pi.py
``` `
#### Control your car
You can now control your car with the virtual joystic on your computer or your phone.
12 changes: 12 additions & 0 deletions docs/99-Contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ This is an opensource project to help accelerate the developement of self drivin
3. Fork the code, make your change and submit a pull request.


###Guiding Developement Principles
* **Modularity**: A self driving system is composed of standalone, independently configurable modules that can be connected modules.

* **Minimalism**: Each component should be kept short (<100 lines of code). Each peice of code should be transparent apon first reading. No black magic, it slows the speed of innovation.

* **Extensiblity**: New components should be simple to create by following a template.

* **Python**: Keep it simple.

***These guidelines are nearly copied from Keras because they are so good***


## Tests
Make sure all tests pass before submitting your pull request.

Expand Down
24 changes: 24 additions & 0 deletions docs/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Datasets

Donkey has several builtin datasets to help users test their autopilots and confirm that they can learn from image sequences.

## Moving Square
A single color moving square bounces around the screen.

Outputs:
* X - 120x160px image of moving square on black background.
* Y - x and y cordinates of center of square in the image. (use options to only return x or y)



## Driving Datasets

### Line Following


### Lane Keeping


### Sidewalk

###
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added docs/hardware/hellion_conquest-top_plate.dwg
Binary file not shown.
File renamed without changes.
5 changes: 3 additions & 2 deletions donkey/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

import os
uname = os.uname()
if uname[1] != 'raspberrypi':
if not uname[4].startswith("arm"):
from . import (utils,
models,
datasets,
remotes,
sensors,
actuators,
mixers,
vehicles,
pilots,
templates,)

else:
print('Detected running on rasberrypi. Only importing select modules.')
from . import actuators, remotes, sensors, vehicles
from . import actuators, mixers, remotes, sensors, vehicles
Loading

0 comments on commit e48ce77

Please sign in to comment.