Skip to content

Commit

Permalink
Update axis_ptz_controller.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Mar 29, 2024
1 parent 4858fd9 commit 87736c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions axis-ptz-controller/axis_ptz_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,16 +741,20 @@ def _track_object(self, time_since_last_update) -> None:
self.v_rst_o_0_t = np.matmul(self.E_XYZ_to_rst, self.v_XYZ_o_0_t)

# Compute object slew rate
# omega = (
# axis_ptz_utilities.cross(self.r_rst_o_0_t, self.v_rst_o_0_t)
# / axis_ptz_utilities.norm(self.r_rst_o_0_t) ** 2
# )
omega = (
axis_ptz_utilities.cross(self.r_rst_o_0_t, self.v_rst_o_0_t)
/ axis_ptz_utilities.norm(self.r_rst_o_0_t) ** 2
)
omega_2 = (
axis_ptz_utilities.cross(self.r_rst_o_1_t, self.v_rst_o_0_t)
/ axis_ptz_utilities.norm(self.r_rst_o_1_t) ** 2
)
self.rho_dot_o = math.degrees(-omega[2])
self.tau_dot_o = math.degrees(omega[0])
rho_2_dot_o = math.degrees(-omega_2[2])
tau_2_dot_o = math.degrees(omega_2[0])

logging.info(f"Object pan and tilt orig rates: {self.rho_dot_o}, {self.tau_dot_o} [deg/s] vs {rho_2_dot_o}, {tau_2_dot_o} [deg/s]")
logging.debug(
f"Object pan and tilt rates: {self.rho_dot_o}, {self.tau_dot_o} [deg/s]"
)
Expand Down

0 comments on commit 87736c4

Please sign in to comment.