Package: obs-picamera
obs-picameraDocumentation:https://gluap.github.io/obs-picameraSource Code:https://github.com/gluap/obs-picameraPyPI:https://pypi.org/project/obs-picamera/A python module to record video of overtaking events to allow vehicle type identification for OpenBikeSensor overtaking events.Building the deviceThis software should work with a Pi Zero W or Pi Zero 2 with raspberry pi camera independently from the case it's mounted in.The idea is to run this on a raspberry pi zero case which can be somehow mounted on the bicycle. An example case for such a mounting with a list of components used can be foundhere, compiled STL files to match it are availablewith logosand withoutInstallation ofobs-picameraThe software is meant to run on a raspberry pi zero. I suggest installing it with Raspberry Pi os. As prerequisites the following packages are required:sudo apt install python-picamera2 python3-pipThe package can then be installed as usual via pip.pipinstall--userobs-picamera# add --upgrade if you want to upgradeUsingobs-picameraYou can run the program by calling (pip install --userhas installed the binary in your~/.local/bin/)obs_picameraWhen it finds an OpenBikeSensor via bluetooth enabled, it will pair with it and whenever it receives an overtaking eventEvents for one OpenBikeSensor Track are stored in a directory with the track-id as the directory name.For each event a shorth264video file is saved, the filename matching the system time of the OpenBikeSensor.Next to the video file a.jsonfile with the Data from the overtaking event is placed. Its content is self-explanatory. The distance already has the handlebar width deducted.I suggest starting obs_picamera automatically at boot - for instance via crontab entry and switching the pi on while still in the home WIFI (which will enable it to pick up a sensible time). Or one may create a phone wifi for it to pick up the time and dateDevelopmentClone this repositoryRequirements:PoetryPython 3.7+Create a virtual environment and install the dependenciespoetryinstallActivate the virtual environmentpoetryshellTestingpytestDocumentationThe documentation is automatically generated from the content of thedocs directoryand from the docstrings
of the public signatures of the source code. The documentation is updated and published as aGithub project pageautomatically as part each release.ReleasingTrigger theDraft release workflow(pressRun workflow). This will update the changelog & version and create a GitHub release which is inDraftstate.Find the draft release from theGitHub releasesand publish it. When
a release is published, it'll triggerreleaseworkflow which creates PyPI
release and deploys updated documentation.Pre-commitPre-commit hooks run all the auto-formatters (e.g.black,isort), linters (e.g.mypy,flake8), and other quality
checks to make sure the changeset is in good shape before a commit/push happens.You can install the hooks with (runs for each commit):pre-commitinstallOr if you want them to run only for each push:pre-commitinstall-tpre-pushOr if you want e.g. want to run all checks manually for all files:pre-commitrun--all-filesThis project was generated using thewolt-python-package-cookiecuttertemplate.