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
This module is designed to be used in concert with other modules to build a complete tracking system. SkyScan, which tracks aircraft using ADS-B transmissions, is an example of the type of system that can be built.
Checkout the docker-compose.yml
in that repo to see how these modules
can be connected together. The configuration for the system is stored in .env
environment files. Examples of the different environment files
are included in the SkyScan repo and can be configured them to match your setup.
- 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: [email protected]
See our other projects: https://github.com/IQTLabs/