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 24d0eec commit a3d2140
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions axis-ptz-controller/axis_ptz_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,12 @@ def _compute_object_pointing(self, time_since_last_update=0) -> None:

# Assign lead time, computing and adding age of object
# message, if enabled
tracking_interval = self.tracking_interval # [s] time_since_last_update
lead_time = self.tracking_interval # [s] time_since_last_update
if self.include_age:
object_msg_age = time() - self.timestamp_o #datetime.utcnow().timestamp() - self.timestamp_o # [s]
logging.debug(f"Object msg age: {object_msg_age} [s]")
tracking_interval += object_msg_age
logging.info(f"Using lead time: {tracking_interval} [s]")
lead_time += object_msg_age
logging.info(f"Using lead time: {lead_time} [s]")

# Compute position and velocity in the topocentric (ENz)
# coordinate system of the object relative to the tripod at
Expand All @@ -631,7 +631,7 @@ def _compute_object_pointing(self, time_since_last_update=0) -> None:
self.vertical_rate_o,
]
)
r_ENz_o_1_t = self.r_ENz_o_0_t + self.v_ENz_o_0_t * tracking_interval
r_ENz_o_1_t = self.r_ENz_o_0_t + self.v_ENz_o_0_t * lead_time

# Compute position, at time one, and velocity, at time zero,
# in the geocentric (XYZ) coordinate system of the object
Expand Down Expand Up @@ -827,6 +827,7 @@ def _track_object(self, time_since_last_update) -> None:
self.tau_c, self.tau_o
),
"tracking_loop_time": elapsed_time,
"time_since_last_update": time_since_last_update,
"object_id": self.object_id,
}
}
Expand Down

0 comments on commit a3d2140

Please sign in to comment.