An autonomous Nerf turret
This package has two optional extras. You must install at least one for camera-related features to work.
[picamera]
can only be installed on Raspberry Pi hardware[opencv]
is used for object recognition.
It can be installed on Pi and non-Pi hardware but is extremely slow to compile on a Pi.To install on a Raspberry Pi, log in and then:
Install the project with
pip install "git+https://github.com/Iain-S/sentry-bot#egg=sentrybot[picamera]"`
Note that we are installing the [picamera]
extra and that the "
quotes are required if using zsh
.
optional Manually compile and install OpenCV by following, for example, these instructions
Proceed to Run the Server
You can install this package on non-Pi hardware using pip
.
Some features of this package will be unavailable on non-Pi hardware but the web server will still run.
If your computer has a camera, you can install the [opencv]
extra.
You should not try to install the [picamera]
extra on non-Pi hardware as installation will fail.
Install the project with
pip install "git+https://github.com/Iain-S/sentry-bot#egg=sentrybot[opencv]"`
Note that we are installing the [opencv]
extra and that the "
quotes are required if using zsh
.
Proceed to Run the Server
git clone path/to/sentry-bot-repo
cd sentry-bot/
(subsequent instructions assume you are in the repo root directory)sentrybot
package and [opencv]
extra with poetry install -E opencv
poetry shell
(subsequent instructions assume this is still active)npm --prefix ./frontend install ./frontend
pre-commit install
The formatters and linters specified in .pre-commit-config.yaml will run whenever you git commit
.
pre-commit run --all-files
./test_backend.sh
./test_frontend.sh
./build_frontend.sh
(you can build whenever a .ts file changes by adding a --watch
argument)sudo pigpiod
CONTROL_TURRET
environment variable to 1
CAMERA_LIBRARY
environment variable to either "picamera"
or "opencv"
python -m sentrybot.http_server
but be aware that it will make the webserver accessible to all machines on the networkip.of.the.pi:8000/
in your web browser, replacing ip.of.the.pi
with your Pi's IP addressCONTROL_TURRET
environment variable to 0
CAMERA_LIBRARY
environment variable to either "picamera"
or "opencv"
python -m sentrybot.http_server
but be aware that it will make the webserver accessible to all machines on the networklocalhost:8000/
in your web browser