An automated tracking service that points AXIS pan-tilt-zoom cameras at flying drones using live GPS coordinates from Kafka and records flight video over VAPIX.
I developed DroneTracker as a containerized service that reads real-time drone position and velocity telemetry from Apache Kafka, computes the required camera orientation angles, and issues pan, tilt, and zoom commands to AXIS optical cameras over the VAPIX network protocol. Because existing control libraries only supported movement commands without video recording, I also forked and updated the camera client library to manage recording sessions on the camera's local storage.
Connecting physical cameras to network telemetry requires handling camera hardware mechanics, network authentication, and video storage management alongside the mathematical coordinate transformations.
During field experiments at AERPAW, researchers frequently fly autonomous drone missions that need high-definition video documentation. Manually operating a camera to follow a fast-moving drone across wide open fields is difficult and unreliable, especially during complex multi-vehicle flights. I developed DroneTracker to automate this process by reading live GPS coordinates from the testbed telemetry stream and continuously aiming an AXIS Q-8615E pan-tilt-zoom camera directly at the aircraft while managing video recording sessions.
The service is published in the quantumbagel/DroneTracker repository and runs as a Docker container deployed at the camera tower site. It listens to Kafka messaging topics for telemetry updates and operator instructions, then communicates with the camera over local network interfaces using the manufacturer's VAPIX API.
The core tracking logic converts latitude, longitude, and altitude measurements from the drone into local camera viewing angles. Pan is calculated as a spherical bearing from the camera's surveyed installation point to the aircraft, tilt is derived from relative elevation and slant range, and zoom is computed using a calibrated field-of-view model that adjusts optical magnification based on drone size and distance. These configuration parameters are stored in a site configuration file so the camera can be redeployed to different towers without code changes.
To keep the camera pointed smoothly at moving targets, the service can apply an optional predictive lead time based on reported velocity vectors. Getting this right required converting velocity components into consistent North-East-Up reference frames, accounting for camera mounting compass offsets, and enforcing minimum angular movement thresholds to keep the motor assembly from oscillating unnecessarily on tiny coordinate fluctuations.
Running tracking software in the field comes with practical network and hardware constraints that do not show up in clean simulated environments. For example, if network lag delays telemetry packets, issuing commands based on old data causes the camera to swing toward where the drone was seconds ago rather than where it is now. To prevent this, the tracker discards outdated packets and parks the camera safely whenever the telemetry stream times out.
Managing video recording also required custom work on the camera interface. The existing open source Python library for AXIS cameras supported basic movement but lacked methods for starting or exporting recordings, so I forked the project to add recording controls and file retrieval over Digest-authenticated HTTP endpoints. The service also includes a dry-run mode that logs computed angles without connecting to a physical camera, making it easy to test logic updates from a laptop before deploying to the field.