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

Mono #14

Merged
merged 31 commits into from
Apr 19, 2021
Merged

Mono #14

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
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
Next Next commit
handle Camera Zoom config
  • Loading branch information
luke-iqt committed Mar 22, 2021
commit 28fe671d842026cb7d0d9a702475feee338c9dfb
18 changes: 18 additions & 0 deletions axis-ptz/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
cameraDelay = None
object_topic = None
flight_topic = None
config_topic = "skyscan/config/json"
pan = 0
tilt = 0
actualPan = 0
Expand Down Expand Up @@ -233,6 +234,22 @@ def moveCamera():
# Sleep for a bit so we're not hammering the camera withupdates
time.sleep(0.005)


def update_config(config):
global cameraZoom
global cameraMoveSpeed
global cameraDelay

if "cameraZoom" in config:
cameraZoom = int(config["cameraZoom"])
logging.info("Setting Camera Zoom to: {}".format(cameraZoom))
if "cameraDelay" in config:
cameraDelay = float(config["cameraDelay"])
logging.info("Setting Camera Delay to: {}".format(cameraDelay))
if "cameraMoveSpeed" in config:
cameraMoveSpeed = int("cameraMoveSpeed")
logging.info("Setting Camera Move Speed to: {}".format(cameraMoveSpeed))

#############################################
## MQTT Callback Function ##
#############################################
Expand Down Expand Up @@ -265,6 +282,7 @@ def on_message(client, userdata, message):
bearingGood = setPan(update["bearing"])
setTilt(update["elevation"])
currentPlane = update
elif message.topic =
else:
logging.info("Message: {} Object: {} Flight: {}".format(message.topic, object_topic, flight_topic))

Expand Down
7 changes: 7 additions & 0 deletions mqtt-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Topic: "skyscan/config/json"

The JSON blob has different config values. There are no required fields. The following Keys are used:
- cameraZoom - int value from 0 - 9999
- cameraDelay - float value for the number of seconds to wait after sending the camera move API command, before sending the take picture API command.
-
-