Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include flight message age in aircraft lead time #44

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Include message in aircraft lead time in calculateCameraPositionB()
  • Loading branch information
Raymond LeClair committed Feb 9, 2023
commit 1804542e1a22c34550096b1e24b0aa052e85ca26
11 changes: 8 additions & 3 deletions axis-ptz/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,20 @@ def calculateCameraPositionB(
# Assign position and velocity of the aircraft
a_varphi = currentPlane["lat"] # [deg]
a_lambda = currentPlane["lon"] # [deg]
# currentPlane["latLonTime"]
a_time = currentPlane["latLonTime"] # [s]
a_h = currentPlane["altitude"] # [m]
# currentPlane["altitudeTime"]
# currentPlane["altitudeTime"] # Expect altitudeTime to equal latLonTime
Copy link
Contributor

@mchadwick-iqt mchadwick-iqt Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ralatsdc - the altitudeTime is not equal to the latLonTime. They come in as separate ADS-B messages and can add up to some sizeable differences if messages get missed. Can you split these out appropriately?

a_track = currentPlane["track"] # [deg]
a_ground_speed = currentPlane["groundSpeed"] # [m/s]
a_vertical_rate = currentPlane["verticalRate"] # [m/s]
# currentPlane["icao24"]
# currentPlane["type"]

# Compute lead time accounting for age of message, and specified
# lead time
a_datetime = utils.convert_time(a_time)
a_lead = (datetime.utcnow() - a_datetime).total_seconds() + camera_lead # [s]

# Assign position of the tripod
t_varphi = camera_latitude # [deg]
t_lambda = camera_longitude # [deg]
Expand All @@ -431,7 +436,7 @@ def calculateCameraPositionB(
a_vertical_rate,
]
)
r_ENz_a_1_t = r_ENz_a_0_t + v_ENz_a_0_t * camera_lead
r_ENz_a_1_t = r_ENz_a_0_t + v_ENz_a_0_t * a_lead

# Compute position, at time one, and velocity, at time zero, in
# the XYZ coordinate system of the aircraft relative to the tripod
Expand Down