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 26, 2024
1 parent 256bad1 commit 28bb7b1
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions axis-ptz-controller/axis_ptz_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,19 +723,19 @@ def _track_object(self, time_since_last_update) -> None:
self.rho_o,
self.tau_o,
)
#self.r_rst_o_1_t = np.matmul(self.E_XYZ_to_rst, self.r_XYZ_o_1_t)
self.r_rst_o_1_t = np.matmul(self.E_XYZ_to_rst, self.r_XYZ_o_1_t)
self.r_rst_o_0_t = np.matmul(self.E_XYZ_to_rst, self.r_XYZ_o_0_t)
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_1_t, self.v_rst_o_0_t)
# / axis_ptz_utilities.norm(self.r_rst_o_1_t) ** 2
# 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_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])
logging.debug(
Expand Down Expand Up @@ -916,14 +916,13 @@ def _orientation_callback(
"""
# Assign camera housing rotation angles
data = self.decode_payload(msg, "Orientation")
logging.info(f"Processing orientation msg data: {data}")
logging.info(f"\t🌎\tProcessing orientation msg data: {data}")
self.alpha = data["tripod_yaw"] # [deg]
self.beta = data["tripod_pitch"] # [deg]
self.gamma = data["tripod_roll"] # [deg]

# Compute the rotations from the geocentric (XYZ) coordinate
# system to the camera housing fixed (uvw) coordinate system
logging.info(f"Initial E_XYZ_to_uvw: {self.E_XYZ_to_uvw}")
(
self.q_alpha,
self.q_beta,
Expand All @@ -942,7 +941,6 @@ def _orientation_callback(
self.rho_c,
self.tau_c,
)
logging.info(f"Final E_XYZ_to_uvw: {self.E_XYZ_to_uvw}")

def _reset_stop_timer(self) -> None:
if hasattr(self, "_timer"):
Expand Down

0 comments on commit 28bb7b1

Please sign in to comment.