This project provides a simple pan and tilt rate controller for AXIS
Communications PTZ network cameras, exemplified by the AXIS
M5525–E PTZ Network Camera, for pointing the camera at an
aircraft. The controller uses the position of the aircraft
reported by aircraft broadcast ADS-B, and pan and tilt of the
camera, to determine pan and tilt rates to follow the aircraft,
adjust camera focus based on range to the aircraft from the
camera, and periodically capture images of the aircraft.
In more detail, the controller subscribes to an MQTT message topic
for ADS-B, or flight, messages, which provide the aircraft
latitude, longitude, altitude, and ground and vertical speeds at
the message time which are used to compute geocentric, and
topocentric position and velocity at the processing time using
WGS84 and linear extrapolation. Camera housing orientation is
represented by yaw, pitch, and roll, and these rotations are
represented by quaternions which are used to compute direction
cosine matrices for transformation between coordinate systems. The
controller subscribes to an MQTT message topic for orientation
messages, such as those published by the EdgeTech-Auto-Orienter,
to set the yaw, pitch, and roll. The controller computes the pan
and tilt of the camera required to point at the aircraft, queries
the camera for its current pan and tilt, then commands a pan and
tilt rate proportional to the pan and tilt differences. The
controller assumes camera focus varies linearly with range to the
aircraft from the camera, then computes and sets focus whenever a
flight message is received. The controller begins capturing images
whenever a new aircraft is encountered, and stops capturing images
if a flight message has not been received in a specified
interval. All controller parameters can be customized through
environment variables, or using an MQTT message published to a
configuration topic. Units of measure are meters, seconds, and
degrees, and operation of the controller is extensively logged.
Make Contribution
·
Report Bug
·
Request Feature
To run this repo, simply run:
docker-compose up
The AXIS PTZ network camera controller is containerized and dependencies are managed using poetry.
Running this repo requires that you have Docker installed.
Spinning up this system requires an MQTT server and this container to
be included in your docker-compose.yml
. You can find an example of
this workflow in this repository's docker-compose.yml
. Additionally,
some editing of relevant environment variables will be required based
upon your system's configuration of topics to subscribe to and MQTT
configuration. Examples of these environment variables can be found in
this repository's template.axis-ptz-controller.env
file.
Copying the project docker-compose
statements into a master
docker-compose.yml
and .env
files with your entire system of
containers is the preferred workflow. Find an application architecture
diagram example of how the usage of this module was envisioned below.
flowchart TD
configdata(Config Data) -- Config Topic --> mqtt{MQTT}
orientationdata(Orientation Data) -- Orientation Topic --> mqtt{MQTT}
flightdata(Flight Data) -- Flight Topic --> mqtt{MQTT}
mqtt{MQTT} -- Config, Orientation, and Flight Topics --> controller(Controller)
controller(Controller) --> capturedata(Capture Data)
capturedata(Capture Data) -- Capture Topic --> mqtt{MQTT}
style mqtt fill:#0072bc,color:#ffffff
style configdata fill:#80c342,color:#ffffff
style orientationdata fill:#80c342,color:#ffffff
style flightdata fill:#80c342,color:#ffffff
style controller fill:#F9D308,color:#ffffff
style capturedata fill:#80c342,color:#ffffff
- TBA
See the open issues for a full list of proposed features (and known issues).
- Fork the Project
- Create your Feature Branch (
git checkout -b dev
) - Commit your Changes (
git commit -m 'adding some feature'
) - Run (and make sure they pass):
black --diff --check *.py
pylint --disable=all --enable=unused-import *.py
mypy --allow-untyped-decorators --ignore-missing-imports --no-warn-return-any --strict --allow-subclassing-any *.py
If you do not have them installed, you can install them with pip install "black<23" pylint==v3.0.0a3 mypy==v0.991
.
- Push to the Branch (
git push origin dev
) - Open a Pull Request
See CONTRIBUTING.md
for more information.
Distributed under the Apache
2.0. See
LICENSE.txt
for more information.
- Twitter: @iqtlabs
- Email: info@iqtlabs.org
See our other projects: https://github.com/IQTLabs/