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

Adding in Object Tracking #11

Merged
merged 31 commits into from
Mar 17, 2021
Merged
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
Prev Previous commit
Next Next commit
Update camera.py
  • Loading branch information
luke-iqt committed Mar 3, 2021
commit 55beaef4eef7f8da97c85fc4e50a950fef4ea46d
7 changes: 4 additions & 3 deletions axis-ptz/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def main():
parser.add_argument('-b', '--bearing', help="What bearing is the font of the PI pointed at (0-360)", default=0)
parser.add_argument('-m', '--mqtt-host', help="MQTT broker hostname", default='127.0.0.1')
parser.add_argument('-t', '--mqtt-flight-topic', help="MQTT topic to subscribe to", default="skyscan/flight/json")
parser.add_argument('-t', '--mqtt-object-topic', help="MQTT topic to subscribe to", default="skyscan/object/json")
parser.add_argument( '--mqtt-object-topic', help="MQTT topic to subscribe to", default="skyscan/object/json")
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)
Expand Down Expand Up @@ -265,12 +265,13 @@ def main():
threading.Thread(target = moveCamera, daemon = True).start()
# Sleep for a bit so we're not hammering the HAT with updates
time.sleep(0.005)
flight_topic=args.mqtt_flight_topic
object_topic = args.mqtt_object_topic
print("connecting to MQTT broker at "+ args.mqtt_host+", channel '"+flight_topic+"'")
client = mqtt.Client("skyscan-axis-ptz-camera-" + ID) #create new instance

client.on_message=on_message #attach function to callback
flight_topic=args.mqtt_flight_topic
object_topic = args.mqtt_object_topic

client.connect(args.mqtt_host) #connect to broker
client.loop_start() #start the loop
client.subscribe(flight_topic+"/#")
Expand Down