Skip to content

Commit

Permalink
Update axis_ptz_utilities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Jun 3, 2024
1 parent 20313c1 commit a46403d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions axis-ptz-controller/axis_ptz_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ def compute_angle_delta( theta_c: float, theta_o: float) -> float:
f"theta_c: {theta_c}, theta_o: {theta_o}, d: {d}, c: {c}, math.fabs(c): {math.fabs(c)}"
)
return 0
if (d > 1.0) or (d < -1.0):
logging.info(
f"D fail - theta_c: {theta_c}, theta_o: {theta_o}, d: {d}, c: {c}"
)
return 0
return math.degrees(math.acos(d)) * c / math.fabs(c)

def compute_camera_rotations(
Expand Down

0 comments on commit a46403d

Please sign in to comment.