seeing-things/track

In CameraTarget get camera frame and mount position nearer in time

Opened this issue · 0 comments

In CameraTarget._camera_to_mount_position() there is an implicit assumption that the mount encoder position and camera frame were both obtained at the same instant in time, however this is not actually the case. Admittedly, I'm not certain if this is causing a significant problem, however it may be a contributing factor to #191.

Consider doing one or more of the following:

  • Refactor such that both mount and camera are read as near in time as feasible in CameraTarget.
  • If we have a reasonably accurate timestamp for the camera frame, predict the mount position at that exact time rather than using the most recently polled mount encoder positions as-is.

With respect to predicting mount positions at different times: The code already supports predicting future mount positions but there's not currently a way to go back and get past positions (and interpolate between them). Maybe it would be reasonable for the mount to cache past positions in a limited-length deque with timestamps to make this past position lookup possible. Maybe add another argument to get_position() to specify the desired past time.