Skip to content

fubarlabs/autonomous

 
 

Repository files navigation

FUBAR Labs Autonomous Racing Vehicles

Autonmous Vehicle Project at Fubar Labs for the Autonomous Powerwheels Racing compeition.

  • Autonomous Powerwheels Racing Pittsburg Makerfiare 2017
  • We totally did laps. We were on the track on time and ready to go!
  • Autonmous Powerwheels Racing Makerfaire NYC 2017
  • Autonmous Vehicle Competition via Sparkfun at Denver Makerfaire 2017

Quickstart

Car Code

Prepare your PI

sudo apt-getupdate
sudo apt-get install python3-pip python3-dev ython3-dev python3-pip python-pip python3-h5py \
python3-numpy python3-matplotlib python3-scipy python3-pandas 

Get TensorFlow for PI installed (http://www.instructables.com/id/Google-Tensorflow-on-Rapsberry-Pi/)

wget https://github.com/samjabrahams/tensorflow-on-raspberry-pi/releases/download/v1.1.0/tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl

Install Tensorflow for Python 3.4

sudo pip3 install pip3 install tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl 

If you have Tensorflow on Raspberry PI with Stretch you need to rename the Tensorflow wheel binary:

cp tensorflow-1.1.0-cp34-cp34m-linux_armv7l.whl tensorflow-1.1.0-cp35-cp35m-linux_armv7l.whl

Fix a potential error message:

sudo pip3 uninstall mock
sudo pip3 install mock

Install the Python libraries:

git clone https://github.com/fubarlabs/autonomous
cd autonomous
virtualenv auto -p python3 
source auto/bin/activate
pip install -r requirements.txt

Set up the raspberry pi services

cd /usr/local/bin
ln -s /autonomous/services/ottoMicroLogger.py
ln -s /autonomous/services/ottoMicroLogger.service
systemctl enable /autonomous/services/ottoMicroLogger.service

Note for Arduino

Code is installed from the Raspberry PI using PLatform IO

sudo pip install platformio

Platform IO is only Python 2.7 but it can program the Arduino. In our chase it's the Fubarion SD board.

Fubarino SD / Arduino Code

Arduino code location: ./autonomous/arduino

cd arduino

MOTTO: Small RC Car Collection Code: MOTTOServoDtaSampleDelay.ino

cd MOTTOServoDataSampleDelay
pio run -t upload

Full Auto Code: MOTTOFullAutoDrive.ino

cd MOTTOFUllAutoDrive.ino
pio run -t upload

OTTO: Power Wheels Autonomus Collection Code: NewOTTOFullAutoDrive.ino

cd NewOTTOFUllAutoDrive.ino
pio run -t upload

Full Auto Code: NewOTTOFullAutoDrive.ino

cd NewOTTOFUllAutoDrive.ino
pio run -t upload

Data Collection Code

Data collection is done as a Raspberry PI service. The folder services contains:

  1. ottologger.py

  2. ottologger.service

  3. Copy ottologger.py /usr/local/bin

  4. register ottologer.service as a system service

  5. Switch on pin 4 enables and disables collection

  6. LED on pin 11 shows the status of collection

Training code

More documentation at the wiki

Autonomous Project Documenatation

Code details

Simple model in basic_model.py. Currently linear with mean squared error loss (summed over outputs?)

Inputs

  • Webcam image
  • Current Accel
  • Current Speed

Future Inputs

  • Current Distance from rangefinder
  • Current Steering wheel angle

Outputs

  • Steering Wheel angle
  • Maybe speed?

Data sources

Notes

Driving model is in current_model.py. Weights are on Google Drive. Line 74 of the model will have to be changed to reflect the true location/name of the weights file.

About

Powerwheels Racing Autonomous Vehicle Model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 51.1%
  • C++ 48.8%
  • Other 0.1%