Creating a Raspberry Pi controlled two wheeled robot to patrol the house.
The current setup consists of:
- Raspberry Pi 3 Model B+
- Raspberry Pi Camera Module
- Adafruit 2.4'' PiTFT
- Adafruit TB6612 Motor Driver
- Kuman RPi GPIO Breakout Expansion Board and Ribbon Cable
- Robotic Platform
Currently, to drive the PiTFT display the software needs to be run as root in
order to write directly to the frame buffer at /dev/fb1
:
$ sudo su
# . ./venv/bin/activate
(venv) # python ./main.py
This project requires OpenCV 3.4
and the contribution libraries or
higher compiled for Python3. The scripts/build_opencv.sh
is provided to
help build OpenCV specifically for this project.
To install the pip requirements:
$ virtualenv ./venv -p python3
...
$ . ./venv/bin/activate
(venv) $ pip install -r ./requirements.txt
Now you'll need to copy the cv2.so
from OpenCV's library to the virtualenv
$ cp /path/to/opencv/lib/cv2.cpython-35m-arm-linux-gnueabihf.so \
./venv/lib/python3.4/site-packages/cv2.so
This project uses the Python unittest
library. To run a single test:
(venv) $ python -m unittest tests.name_of_unit_tests.TestFixture.test_name
where name_of_unit_tests
matches a file in the tests/
directory,
TestFixture
matches the class name in that file, and test_name
matches
the member function of TestFixture
to run.
To run the entire suite of unit tests:
(venv) $ python -m unittest discover -s tests -p "*_unit_tests.py"
The patrolbot
library consists of:
flask_app/
- Contains an implementation of web UI using Flaskgui/
- Contains the onboard GUI implementation using PyGamesensors/camera
- Interface to the Raspberry Pi camera using OpenCV