Autotracking fixes (#7096)

* only check camera status if autotracking enabled

* a more sensible sleep time

* Only check camera status if preparing for a move

* only update tracked obj position when ptz stopped

* both pantilt *and* zoom should be idle

* check more often after moving

* No need to move pan and tilt separately
This commit is contained in:
Josh Hawkins
2023-07-08 16:02:54 -05:00
committed by GitHub
parent f37f034b6a
commit 691e9d26d2
2 changed files with 16 additions and 15 deletions

View File

@@ -247,14 +247,7 @@ class OnvifController:
"Zoom": 0,
}
# move pan and tilt separately
move_request.Translation.PanTilt.x = pan
move_request.Translation.PanTilt.y = 0
move_request.Translation.Zoom.x = 0
onvif.get_service("ptz").RelativeMove(move_request)
move_request.Translation.PanTilt.x = 0
move_request.Translation.PanTilt.y = tilt
move_request.Translation.Zoom.x = 0
@@ -350,7 +343,7 @@ class OnvifController:
status_request = self.cams[camera_name]["status_request"]
status = onvif.get_service("ptz").GetStatus(status_request)
if status.MoveStatus.PanTilt == "IDLE" or status.MoveStatus.Zoom == "IDLE":
if status.MoveStatus.PanTilt == "IDLE" and status.MoveStatus.Zoom == "IDLE":
self.cams[camera_name]["active"] = False
self.camera_metrics[camera_name]["ptz_stopped"].set()
else: