Giter Site home page Giter Site logo

quantumbagel / cameradistance Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 76 KB

A drone-following script for NC State's AERPAW drones.

Home Page: https://quantumbagel.github.io/CameraDistance

Python 99.18% Dockerfile 0.82%
axis-camera internship-project onvif python python3 recording trigonometry vapix

cameradistance's Introduction

CameraDistance

A drone-following script for NC State's AERPAW drones

Disclaimer: This guide is written for Linux users. This program should work great on all operating systems, just adapt as necessary.

What does this do?

This program controls AXIS cameras supporting VAPIX to track MavLink/ArduPilot drones and record video of the drones.

Its features include

  • Customizable recording triggers
  • Can zoom to fit drone in view or with a certain amount of space around it
  • Can handle drone software crashes or disconnects and quickly recover
  • Can support as many drones as you need via config
  • Works with any AXIS PTZ camera supporting VAPIX or any ArduPilot/MavLink based drone and many more!

Configuration Options

Configuration Option Description
camera/alt The altitude (from sea level) for the camera's lens.
camera/lat, camera/long The latitude and longitude of the camera's lens.
camera/radius_activate The maximum radius that the drone can be for the camera to be active
camera/offset The camera's offset from north (clockwise)
camera/deactivate_pos/pan, camera/deactivate_pos/tilt The pan/tilt to deactivate the camera to when it is not in use.
camera/min_step The minimum change in the pan/tilt (degrees) from the camera's current position for the program to send an update
camera/min_zoom_step The minimum change in the zoom cycles from the camera's current zoom for the program to send an update
camera/wait The delay between ticks. 0 should be fine, but if you are running on an old CPU, 0.1 will lower usage drastically
camera/activate_method How to detect if the camera should be recording. armed: when the drone arms/disarms, file: when the file 'record' starts with a 1 or 0, start/stop recording, relative-height: you must put "relative-height5" or a number.
camera/delay The delay after the program detects it should not be recording for the camera to stop recording.
camera/maximum_zoom The maximum zoom of the camera.
camera/is_upside_down Is the camera upside down?
camera/zoom_error How much space to have outside of the zoom (1.2 has 20% more space, 0.8 has 80% of the space)
drone/address The drone addresses. Format: name: [prefix, start port, number of ports to check sequentially]
drone/x, drone/y, drone/z The size of the drone (height, width, depth)
drone/msg_timeout The timeout of the camera's messages to connect to the drone
scale/dist, scale/width At 1x zoom, looking straight ahead, the camera's horizontal FOV at dist meters away is width. This has been calibrated for the AXIS Q-8615E PTZ camera.
login/ip, login/username, login/password The ip, username, and password of the camera.
debug The log level of the program. 0 is none, 1 is normal, 2 is debug.

Installation Guide

You can either run this locally or inside a Docker container.

Running Locally

Enter the directory, and run pip3 install -r requirements.txt

Change config.yaml's options to what you want.

Then, just run python3 dronetracker.py and you should be good!

Running in a Dockerfile

Make sure Docker is installed.

Change config.yaml's options to what you want.

Then, enter the project directory and run this one liner: sudo docker compose build && sudo docker compose up -d You should be good to go!

If Things Don't Go Right

Just open an issue! I am active and will try my best to help with fixing your issue!

cameradistance's People

Contributors

quantumbagel avatar

Stargazers

 avatar

Watchers

 avatar  avatar

cameradistance's Issues

Config camera.offset parameter doesn't function

I'm trying to put a 45 degree offset on the camera movement, however when editing the camera.offset parameter in config.yml, I don't see any change in how the camera is pointed. There is no difference in the pan of the camera between an offset of 0 and 45 (assuming the drone position is constant).

From what I understand, the camera.offset parameter is for offsetting the pan (tell me if this is wrong) of the camera. My specific problem is that when a drone is directly south of the camera, the camera is instead pointing southeast. So, I am trying to enforce a 45 degree offset to correct this. For the record, I don't think this is an issue with the camera incorrectly calculating the pan as the pan printing in the console when running with debug output seems correct. I think that it's just that the camera is not mounted facing north, hence the offset is needed.

Here is a screenshot of the relevant portion of my config file:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.