Skip to content

Commit

Permalink
Update camera.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Apr 6, 2024
1 parent 9e1d04b commit 18c0969
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions axis-ptz-controller/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def __init__(

# Initialize pan and tilt rate indices, which are between -100
# and 100
self.pan_rate_index = 0
self.tilt_rate_index = 0
self.pan_rate_index = 0.0
self.tilt_rate_index = 0.0

# Always construct camera configuration and control since
# instantiation only assigns arguments
Expand Down Expand Up @@ -410,7 +410,7 @@ def _compute_pan_rate_index(self, rho_dot: float) -> None:
self.pan_rate_index = +100

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

def _compute_tilt_rate_index(self, tau_dot: float) -> None:
"""Compute tilt rate index between -100 and 100 using rates in
Expand All @@ -432,7 +432,7 @@ def _compute_tilt_rate_index(self, tau_dot: float) -> None:
self.tilt_rate_index = 100

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

def get_yaw_pitch_roll(self) -> Tuple[float, float, float]:
"""
Expand Down

0 comments on commit 18c0969

Please sign in to comment.