Skip to content

IQTLabs/edgetech-axis-ptz-controller

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Edgetech-Axis-Ptz-Controller

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

Usage

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.

Built With

Python Poetry Docker

Roadmap

  • TBA

See the open issues for a full list of proposed features (and known issues).

Contributing

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b dev)
  3. Commit your Changes (git commit -m 'adding some feature')
  4. 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.

  1. Push to the Branch (git push origin dev)
  2. Open a Pull Request

See CONTRIBUTING.md for more information.

License

Distributed under the Apache 2.0. See LICENSE.txt for more information.

Contact IQTLabs

See our other projects: https://github.com/IQTLabs/

(back to top)

About

A Rate-Based Controller for controlling an Axis-PTZ

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages