Skip to content
This repository was archived by the owner on Apr 24, 2020. It is now read-only.

Commit 6eced74

Browse files
authored
V2.1 - Refactor to modular architecture. (autorope#89)
* First untested cut of the Pololu Meastro support * Move the import of the serial module to the class where it is needed * Fix some sh/bash problems * Make the web app selfcontained so it does not rely on an internet connection * Get the pyserial into the docker image as well * Add tornado.gen import. Not sure how that worked without it * Use a USB webcam instead of the RaspiCam * Add support for some LED blinky lights * Adapt the drive.py to the Maestro & webcam used with the TK1 * Wrong module for requests.ReadTimeout? * Apparently my webcam can not do the small resolution, do it explicitly * First attempt to add a speed sensor and handle the extra data all the way * More on the extra saved parameters * Fix the json file name for the removal * More fixes for the addition of the speed data * Still working on the extra speed data * Trying to push the brake/stop/drive state to the vehicle * Print the drive value as well * More speed related changes * PID setup for traottle * More handling of speed and drive values * More on getting the target speed back to the vehicle * Initialize the target speed in the user case * removed unused package imports, thanks spyder! * First step to collect linear acceleration vales * One space too much * clean unused components * first progress on refactor * second commit of refactor * add travis.yaml script * fixed name of travis.yml' * simple part working * moving square example without datastore working * Fix for the linaccel addition * A litte script to start the training * A litte script to start the driving * More problems with the speed/imu sensors * Extra locking around the serial communications to the A* * Make the startup script executable * Handle server errors (http status != 200) better * Multithread serial problems * moving square example now working * add web_controller example * moved parts to their own directories * update docs and tests structure * add tests and docs * update travis script * add pandas to setup * attempt to fix travis * specify pandas version * specify pandas version * Update README.md * specify pandas version * Update README.md * switched index to use pandas, separated tub writer and reader * fixed calibrate script * added donkey2 script to drive * fixed actuator * fix donkey2 example * add custom PWM settings * add shutdown for steering and throttle * add tub to donkey2 example * reduced frame rate * update docs * add CNAME for gh-pages and update tests * update readme * Add kenneth's websocket code * Give the model a bit more time * Donkey2 with Odometer (autorope#96) * odometer part and example vehicle script * rename file to match class name * declare in parts init * fix output syntax * bug fix * attempt to prevent shutdown error * fix isr arg * new filename * add distance to odometer output * change output path * clean up the comments * Sort the sessions * Fix the linaccel == None case * linaccel might not have a value * TK1 parts * Cleanup * Cleanup drive setuo * Cleanup * Add the speed and RCin inputs * Fix the usage of the RC input * First attempt to add the sessions back in * Record the session only when requested, sessions web interface * fix find_car.py script to use users existing ip * rename folders to donkeycar * remove dist folder * updated create car script * removed opencv * fixed web ui joystick for iphone 5s, 6, ipad 2 (autorope#106) * fix misspellings * added tub handler * Move the rest of the files as well * More rename related changes * updated tub to use json files * got basic keras training working * update docs with install instructions * fix install * Add a store which mimics the old session store * fix test errors * removed unneded files" * update web controller to remove sessions * refactored actuators to work again * remove write flag * edits to test performacne * fixes found when performance testing * added conditional option for parts * updated webcontroller url * update docs and more * update readme * update setup * updated square example * add relu model and add model to donkey2 template * fixed training * make default donkey2 stay on longer. * race updates * fix training * updates from car * change to jpg pics * load model in drivemode * fixed drive mode error for local_angle" * increment version
1 parent aa6f2ce commit 6eced74

File tree

116 files changed

+3115
-11811
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3115
-11811
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
env/*
22
data/*
3+
dist/*
34
*.pyc
45
.ipynb_checkpoints
56
*.egg-info/
67
.git.bfg-report
78
.DS_Store
89
lag_log.csv
910
.spyproject
11+
.cache
12+
site/*

.travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: python
2+
python:
3+
- "3.4"
4+
- "3.5"
5+
- "3.6"
6+
7+
before_install:
8+
- sudo apt-get -qq update
9+
- sudo apt-get install -y python-numpy
10+
11+
# command to install dependencies
12+
install: "pip install -e ."
13+
14+
# command to run tests
15+
script: python -m unittest
16+
17+
# safelist
18+
branches:
19+
only:
20+
- master
21+
- dev

Dockerfile

-28
This file was deleted.

README.md

+34-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
1-
# Donkey: a self driving library and control platform for small scale DIY vehicles.
1+
![travis](https://travis-ci.org/wroscoe/donkey.svg?branch=dev)
22

3-
Donkey is minimalist and modular self driving library written in Python. It is developed for hobbiests with a focus on allowing fast experimentation and easy community contributions.
3+
# donkeycar: a python self driving library
44

5-
---------------------------
6-
**REFACTOR IN PROGRESS**
5+
Donkeycar is minimalist and modular self driving library written in Python. It is
6+
developed for hobbiests and students with a focus on allowing fast experimentation and easy
7+
community contributions.
78

8-
*We've learned a lot in the past couple months and working to implement many of those changes in a new version Donkey 2.1. This version will make it easy for users to contribe new pilots, sensors, controllers, and actuators rather than needing to rewrite the the whole code base. This new ROS'ish version lives in the [dev branch](https://github.com/wroscoe/donkey/tree/dev) and will be merged into master on July 16th. All the hardware in the standard build will be supported and most of the funcationality for driving/training will remain.*
9-
10-
11-
---------------------------
12-
13-
14-
### [Build a Donkey Car.](http://www.donkeycar.com) ($200 + 2 hours)
9+
#### Quick Links
10+
* [Code Documentation](http://docs.donkeycar.com)
11+
* [Instructions to build a Donkey2 car.](http://www.donkeycar.com)
1512

1613
#### Use Donkey if you want to:
1714
* Make an RC car drive its self.
1815
* Compete in self driving races like [DIY Robocars](diyrobocars.com)
19-
* Use existing autopilots to drive your car.
20-
* Use community datasets to create, improve and test autopilots that other people can use.
21-
22-
23-
#### Features:
24-
* Data logging of image, steering angle, & throttle outputs.
25-
* Wifi car controls (a virtual joystic).
26-
* Community contributed driving data and autopilots.
27-
* Hardware CAD designs for optional upgrades.
28-
29-
30-
### Drive your car
31-
Once you have built your car and it's connected to the same wifi as your computer.
32-
33-
1. Open a terminal and clone the donkey repo: `git clone https://github.com/wroscoe/donkey`
34-
2. Start the default pilot server using docker: `bash start-server.sh`
35-
3. Open a new terminal and find your car's Raspberry Pi's IP address: `python scripts/find_car.py`
36-
4. SSH to your car's Raspberry Pi: `ssh pi@<your pi's ip address>` (default password = raspberry)
37-
5. Start your car's driver loop: `python scripts/drive.py --remote http://<your computers ip address>:8887`
38-
6. Turn on your car.
39-
7. Go to `<your_pilot_server_ip>:8887` on your phone or computer to start driving your car.
40-
41-
42-
43-
44-
45-
46-
16+
* Experiment with different driving methods.
17+
* Add parts and sensors to your car.
18+
* Log sensor data. (images, user inputs, sensor readings)
19+
* Drive yoru car via a web or game controler.
20+
* Leverage community contributed driving data.
21+
* Use existing hardware CAD designs for upgrades.
22+
23+
### Getting started.
24+
After building a Donkey2, here are the steps to start driving.
25+
26+
install donkey
27+
```
28+
pip install donkeycar
29+
```
30+
31+
Create a car folder.
32+
```
33+
donkey createcar --path ~/d2
34+
```
35+
36+
Start your car.
37+
```
38+
python ~/d2/manage.py drive
39+
```
40+
41+
Now you can control your car by going to `<ip_address_of_your_pi>:8887/drive`

config/default.h5

-487 KB
Binary file not shown.

config/vehicle.ini

-31
This file was deleted.

docs/01-build_a_car.md

-3
This file was deleted.

docs/02-start_driving.md

-31
This file was deleted.

docs/04-Connect_to_AWS_Instance.md

-20
This file was deleted.

docs/99-Contribute.md

-25
This file was deleted.

docs/CNAME

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs.donkeycar.com

docs/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Donkey Docs
2+
3+
The source of the documenation gets built in the folder `../site` and is
4+
published to (http://wroscoe.github.io/donkey). Our docs use extended markdown
5+
as implemented by MkDocs.
6+
7+
### Building the documentation
8+
9+
* install MkDocs `pip install mkdocs`
10+
* `mkdocs serve` starts a local webserver at localhost:8000
11+
* `mkdocs build` Builds a static site in `../site` directory
12+
* config docs with (../mkdocs.yml)

docs/contribute.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
# Contribute to Donkey
3+
Donkey is an opensource project to help accelerate the developement of
4+
self driving autos.
5+
6+
###Guiding Developement Principles
7+
8+
* **Modularity**: A self driving system is composed of standalone,
9+
independently configurable components that can be combined to make a car.
10+
* **Minimalism**: Each component should be kept short (<100 lines of code).
11+
Each peice of code should be transparent apon first reading. No black magic,
12+
it slows the speed of innovation.
13+
* **Extensiblity**: New components should be simple to create by following a
14+
template.
15+
* **Python**: Keep it simple.
16+
17+
***These guidelines are nearly copied from [Keras](http://keras.io) because they are so good***
18+
19+
20+
21+
### Add a part.
22+
Are you a hardware specialist that can write a donkey part wrapper for a
23+
GPS unit or a data scientist that can write an recursive neural net autopilot?
24+
If so please write a part so other people driving donkeys can use the part.
25+
26+
### Fix or report a bug.
27+
If you find a problem with the code and you know how to fix it then please
28+
clone the repo, make your fix, and submit your pull request.
29+
30+
### Reply to issues.
31+
Helping close or triage the issues is a good way to help.
32+
33+
34+
### Need Inspiration?
35+
Search the code or docs for `TODO` to find places where you might be able
36+
to find a better solution.
37+
38+
### Improve the documentation.
39+
You can fix grammar or provide clarity by clicking the the *Edit on GitHub*
40+
link in the top right corner.

docs/datasets.md

-17
This file was deleted.

docs/extra.css

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blockquote {background: khaki; padding: 0 10px;}

docs/faq.md

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# How do I create my own Raspberry Pi Disk?
2+
If you don't want to use the disk image for the Raspberry Pi you can
3+
install the packages like this.
4+
5+
1. Setup OS on Raspberry Pi
6+
Follow [these instructions](https://www.raspberrypi.org/learning/software-guide/quickstart/)
7+
to install the Raspbian Jessie operating system using the NOOBS method
8+
on your SD card.
9+
P
10+
2. ut the SD card into your Raspberry Pi.
11+
3. Power up your Raspberry Pi using the USB cable.
12+
4. Connect to a wifi internet connection.
13+
14+
##### Install Basic Libraries
15+
Since the Raspberry Pi is not as fast as larger computers, it can take a long time to install python packages (ie. numpy & PIL) using pip. Luckily Adafruit has precompiled these libraries into packages that can be installed via `apt-get`.
16+
17+
1. Open a terminal (Ctrl-Alt-t) and upgrade your system packages.
18+
```
19+
sudo apt-get update
20+
sudo apt-get upgrade
21+
```
22+
23+
2. Install necessary libraries
24+
```
25+
sudo apt-get install xsel xclip libxml2-dev libxslt-dev libzmq-dev libspatialindex-dev virtualenv
26+
```
27+
3. Pandas & Jupyter Requirements
28+
29+
```
30+
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
31+
```
32+
5. Scientific Python
33+
```
34+
sudo apt-get install python3-numpy python3-matplotlib python3-scipy python3-pandas
35+
```

docs/guide/build_hardware.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Instructions to build a Donkey Car
2+
3+
The standard hardware build instructions can be found in this
4+
[google doc](https://docs.google.com/document/d/11IPqZcDcLTd2mtYaR5ONpDxFgL9Y1nMNTDvEarST8Wk/edit#heading=h.ayg28mpf8hvb).
5+
6+
Once you have the car built and the Raspbery Pi running with the given
7+
disk image follow these steps to start running the latest version of Donkey.
8+
9+
10+
11+
12+
File renamed without changes.

0 commit comments

Comments
 (0)