Skip to content

Commit

Permalink
fix tilt/pan rate_index bug I created
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Mar 25, 2024
1 parent 5700ebf commit 917161c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions axis-ptz-controller/axis_ptz_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,13 +1195,13 @@ def _compute_pan_rate_index(self, rho_dot: float):
-------
"""
if rho_dot < -self.pan_rate_max:
self.pan_rate = -100
self.pan_rate_index = -100

elif self.pan_rate_max < rho_dot:
self.pan_rate = +100
self.pan_rate_index = +100

else:
self.pan_rate = round((100 / self.pan_rate_max) * rho_dot)
self.pan_rate_index = round((100 / self.pan_rate_max) * rho_dot)


def _compute_tilt_rate_index(self, tau_dot: float):
Expand All @@ -1218,13 +1218,13 @@ def _compute_tilt_rate_index(self, tau_dot: float):
-------
"""
if tau_dot < -self.tilt_rate_max:
self.tilt_rate = -100
self.tilt_rate_index = -100

elif self.tilt_rate_max < tau_dot:
self.tilt_rate = 100
self.tilt_rate_index = 100

else:
self.tilt_rate = round((100 / self.tilt_rate_max) * tau_dot)
self.tilt_rate_index = round((100 / self.tilt_rate_max) * tau_dot)

def _capture_image(self) -> None:
"""When enabled, capture an image in JPEG format, and publish
Expand Down

0 comments on commit 917161c

Please sign in to comment.