Skip to content

Commit

Permalink
added more robust checks to make sure self.object exists
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Jun 21, 2024
1 parent f015e7f commit efa6136
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion axis-ptz-controller/axis_ptz_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,10 @@ def _track_object(self, time_since_last_update: float) -> None:
self.camera.update_focus(self.object.distance_to_tripod3d)
self.camera.update_pan_tilt_rates(self.rho_dot_c, self.tau_dot_c)

if not self.do_capture:
if self.object is None:
logging.error(f"REALLY not sure why it is None here, but not earlier")
return
if not self.do_capture and self.object is not None:
logging.info(
f"Starting image capture of object: {self.object.object_id}"
)
Expand Down

0 comments on commit efa6136

Please sign in to comment.