Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging in Dev branch #2

Merged
merged 74 commits into from
Jan 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
cfd53c2
initial commit
luke-iqt Dec 18, 2020
ab039c5
Update README.md
luke-iqt Dec 18, 2020
377fb22
adding a builtin DB
luke-iqt Dec 19, 2020
6820f38
Update flighttracker.py
luke-iqt Dec 19, 2020
49b8ccd
Dockerized!
luke-iqt Dec 21, 2020
f3bc8e1
Update docker-compose.yml
luke-iqt Dec 21, 2020
665fe4b
Update flighttracker.py
luke-iqt Dec 21, 2020
3e3d447
adding azimuth calculations
luke-iqt Dec 21, 2020
de058a2
Add a camera listener
luke-iqt Dec 22, 2020
86e74dd
controlling the pan tilt hat - basic
luke-iqt Dec 22, 2020
659f083
permission to access the I2C bus
luke-iqt Dec 22, 2020
7f57e5d
Update docker-compose.yml
luke-iqt Dec 22, 2020
1ba7afd
Update docker-compose.yml
luke-iqt Dec 22, 2020
e5a30d0
Update requirements.txt
luke-iqt Dec 22, 2020
f5a6c61
Update camera.py
luke-iqt Dec 22, 2020
9d8f94b
so that is how you ref dicts
luke-iqt Dec 22, 2020
b5436c2
Update camera.py
luke-iqt Dec 22, 2020
5cfe059
Update camera.py
luke-iqt Dec 22, 2020
0dffad5
Update camera.py
luke-iqt Dec 22, 2020
98063f9
Update camera.py
luke-iqt Dec 22, 2020
aec3975
Update camera.py
luke-iqt Dec 22, 2020
f3ba1a5
better pan calculations
luke-iqt Dec 22, 2020
ee5fbd5
better messages
luke-iqt Dec 22, 2020
758cbb3
Update camera.py
luke-iqt Dec 22, 2020
f21a428
Update camera.py
luke-iqt Dec 22, 2020
41e3520
Update flighttracker.py
luke-iqt Dec 22, 2020
eee7900
Update camera.py
luke-iqt Dec 22, 2020
89126e7
Update camera.py
luke-iqt Dec 22, 2020
cff5528
Update camera.py
luke-iqt Dec 22, 2020
2c1da38
Update camera.py
luke-iqt Dec 23, 2020
b77b0b3
Update camera.py
luke-iqt Dec 23, 2020
ff1c35b
Update camera.py
luke-iqt Dec 23, 2020
e272f04
Update camera.py
luke-iqt Dec 23, 2020
398e20a
Update camera.py
luke-iqt Dec 23, 2020
9d0f0b1
Update camera.py
luke-iqt Dec 23, 2020
4c14865
Update camera.py
luke-iqt Dec 23, 2020
6bfb3fd
Update camera.py
luke-iqt Dec 23, 2020
e5b2c4c
Update camera.py
luke-iqt Dec 23, 2020
bf2ae91
Update camera.py
luke-iqt Dec 23, 2020
bc619ab
photo snapping
luke-iqt Dec 24, 2020
7807678
Update docker-compose.yml
luke-iqt Dec 26, 2020
a5e6161
better linking
luke-iqt Dec 26, 2020
7d41ef2
Update docker-compose.yml
luke-iqt Dec 26, 2020
7fb0907
Update docker-compose.yml
luke-iqt Dec 26, 2020
a917696
fix for picam?
luke-iqt Dec 26, 2020
985e835
Update README.md
luke-iqt Dec 26, 2020
5298708
Update camera.py
luke-iqt Dec 26, 2020
5e2c38d
Update camera.py
luke-iqt Dec 26, 2020
834693a
Update camera.py
luke-iqt Dec 26, 2020
6731e2d
Update camera.py
luke-iqt Dec 26, 2020
a1e0207
Update camera.py
luke-iqt Dec 26, 2020
2008809
base elevation
luke-iqt Dec 28, 2020
a101dcc
Update camera.py
luke-iqt Dec 28, 2020
06b78b1
Added a ADSB-MQTT bridge
luke-iqt Jan 5, 2021
1c6ed02
Tracking with Axis PTZ
luke-iqt Jan 7, 2021
4ca9969
corrected terms: azimuth->elevation
luke-iqt Jan 7, 2021
33c1c56
added customized folders for saving pictures
luke-iqt Jan 8, 2021
8d22750
Update utils.py
luke-iqt Jan 8, 2021
caf28f9
changing permissions
luke-iqt Jan 8, 2021
c57895e
Update dockerfile
luke-iqt Jan 8, 2021
2a12d45
Update docker-compose.yml
luke-iqt Jan 8, 2021
e672725
Update docker-compose.yml
luke-iqt Jan 8, 2021
b9053f6
correcting docker-compose build
luke-iqt Jan 8, 2021
32d8e88
cleaned up printing
luke-iqt Jan 9, 2021
aefa14f
added restart
luke-iqt Jan 9, 2021
5ab3b28
Update flighttracker.py
luke-iqt Jan 9, 2021
f372af4
fix a divide by zero error
luke-iqt Jan 9, 2021
115e620
setting altitude
luke-iqt Jan 9, 2021
077245f
Update flighttracker.py
luke-iqt Jan 9, 2021
83048c5
Update camera.py
luke-iqt Jan 9, 2021
23be7db
added additional configuration
luke-iqt Jan 11, 2021
92f6496
Update README.md
luke-iqt Jan 11, 2021
3dc8351
updating readme
luke-iqt Jan 11, 2021
4fc9f83
improved documentation
luke-iqt Jan 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added additional configuration
  • Loading branch information
luke-iqt committed Jan 11, 2021
commit 23be7dbf0bd7ee39fc6b17dc2ba1a3ae3e4085f6
14 changes: 14 additions & 0 deletions axis-ptz/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
args = None
camera = None
cameraConfig = None
cameraZoom = None
cameraMoveSpeed = None
cameraDelay = None
pan = 0
tilt = 0
actualPan = 0
Expand Down Expand Up @@ -128,6 +131,8 @@ def get_jpeg_request(): # 5.2.4.1
text = str(resp)
text += str(resp.text)
return text


def moveCamera():
global actualPan
global actualTilt
Expand Down Expand Up @@ -185,6 +190,9 @@ def main():
global pan
global tilt
global camera
global cameraDelay
global cameraMoveSpeed
global cameraZoom
global cameraConfig

parser = argparse.ArgumentParser(description='An MQTT based camera controller')
Expand All @@ -195,6 +203,9 @@ def main():
parser.add_argument('-u', '--axis-username', help="Username for the Axis camera", required=True)
parser.add_argument('-p', '--axis-password', help="Password for the Axis camera", required=True)
parser.add_argument('-a', '--axis-ip', help="IP address for the Axis camera", required=True)
parser.add_argument('-s', '--camera-move-speed', type=int help="The speed at which the Axis will move for Pan/Tilt (0-100)", default=0)
parser.add_argument('-d', '--camera-delay', type=float help="How many seconds after issuing a Pan/Tilt command should a picture be taken", default=0.5)
parser.add_argument('-z', '--camera-zoom', type=int help="The zoom setting for the camera (0-9999)", defult=9999)
parser.add_argument('-v', '--verbose', action="store_true", help="Verbose output")

args = parser.parse_args()
Expand All @@ -218,6 +229,9 @@ def main():

logging.info("---[ Starting %s ]---------------------------------------------" % sys.argv[0])
camera = vapix_control.CameraControl(args.axis_ip, args.axis_username, args.axis_password)
cameraDelay = args.camera_delay
cameraMoveSpeed = args.camera_move_speed
cameraZoom = args.camera_zoom
cameraConfig = vapix_config.CameraConfiguration(args.axis_ip, args.axis_username, args.axis_password)
threading.Thread(target = moveCamera, daemon = True).start()
# Sleep for a bit so we're not hammering the HAT with updates
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:

tracker:
build: ./tracker
entrypoint: "./flighttracker.py -m mqtt -l ${LAT} -L ${LONG} -a ${ALT} -P skyscan/planes/json -T skyscan/tracking/json -M ${MIN_ELEVATION} "
entrypoint: "./flighttracker.py -m mqtt -l ${LAT} -L ${LONG} -a ${ALT} -P skyscan/planes/json -T skyscan/tracking/json -M ${MIN_ELEVATION} -c ${CAMERA_LEAD}"
depends_on:
- mqtt
restart: unless-stopped
Expand Down Expand Up @@ -36,7 +36,7 @@ services:

axis-ptz:
build: ./axis-ptz
entrypoint: "./camera.py -m mqtt -t skyscan/tracking/json -u ${AXIS_USERNAME} -p ${AXIS_PASSWORD} -a ${AXIS_IP}"
entrypoint: "./camera.py -m mqtt -t skyscan/tracking/json -u ${AXIS_USERNAME} -p ${AXIS_PASSWORD} -a ${AXIS_IP} -z ${CAMERA_ZOOM} -s ${CAMERA_MOVE_SPEED} -d ${CAMERA_DELAY}"
volumes:
- ./capture:/app/capture
depends_on:
Expand Down
4 changes: 4 additions & 0 deletions env-example
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ FEEDER_ID=long-api-key-goes-here
AXIS_USERNAME=user
AXIS_PASSWORD=pass
AXIS_IP=192.168.1.1
CAMERA_MOVE_SPEED=50
CAMERA_DELAY=0.5
CAMERA_ZOOM=9999
CAMERA_LEAD=0.25
RTL_DEV=1
7 changes: 5 additions & 2 deletions tracker/flighttracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
camera_latitude = None
camera_longitude = None
camera_altitude = None
camera_lead = None
min_elevation = None

# http:https://stackoverflow.com/questions/1165352/fast-comparison-between-two-python-dictionary
Expand Down Expand Up @@ -341,7 +342,7 @@ def __publish_thread(self):
if cur is None:
continue

(lat, lon) = utils.calc_travel(cur.getLat(), cur.getLon(), cur.getLoggedDate(), cur.getGroundSpeed(), cur.getTrack(), 0.25)
(lat, lon) = utils.calc_travel(cur.getLat(), cur.getLon(), cur.getLoggedDate(), cur.getGroundSpeed(), cur.getTrack(), camera_lead)
distance = utils.coordinate_distance(self.__latitude, self.__longitude, lat, lon)
# Round off to nearest 100 meters
distance = round(distance/100) * 100
Expand Down Expand Up @@ -458,17 +459,18 @@ def main():
global camera_altitude
global camera_latitude
global camera_longitude
global camera_lead
global min_elevation
parser = argparse.ArgumentParser(description='A Dump 1090 to MQTT bridge')


parser.add_argument('-l', '--lat', type=float, help="Latitude of camera")
parser.add_argument('-L', '--lon', type=float, help="Longitude of camera")
parser.add_argument('-a', '--alt', type=float, help="altitude of camera", default=0)
parser.add_argument('-c', '--camera-lead', type=float, help="how many seconds ahead of a plane's predicted location should the camera be positioned", default=0.25)
parser.add_argument('-M', '--min-elevation', type=int, help="minimum elevation for camera", default=0)
parser.add_argument('-m', '--mqtt-host', help="MQTT broker hostname", default='127.0.0.1')
parser.add_argument('-p', '--mqtt-port', type=int, help="MQTT broker port number (default 1883)", default=1883)

parser.add_argument('-P', '--plane-topic', dest='plane_topic', help="MQTT plane topic", default="skyscan/planes/json")
parser.add_argument('-T', '--tracking-topic', dest='tracking_topic', help="MQTT tracking topic", default="skyscan/tracking/json")
parser.add_argument('-v', '--verbose', action="store_true", help="Verbose output")
Expand All @@ -481,6 +483,7 @@ def main():
camera_longitude = args.lon
camera_latitude = args.lat
camera_altitude = args.alt
camera_lead = args.camera_lead
min_elevation = args.min_elevation
level = logging.DEBUG if args.verbose else logging.INFO

Expand Down