Skip to content

flightreport: automatic flight reports from recorded tlogs and thermal video - #61

Draft
tridge wants to merge 7 commits into
ArduPilot:mainfrom
tridge:pr-flight-report
Draft

tridge wants to merge 7 commits into
ArduPilot:mainfrom
tridge:pr-flight-report

Conversation

@tridge

@tridge tridge commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a flight report service that runs beside the proxy. For an entry that has monitoring turned on it reads the tlog and the raw thermal recordings the proxy is already writing, and builds a public report page for the flight as it goes on.

  • Heat sources: the camera's own detections (DATA96 type 68), and hotspots above a threshold from CAMERA_THERMAL_RANGE projected to the ground.
  • Orbits: found from the flight modes. The thermal video of each orbit is cut out and sent to a GPU server over ssh, which builds a 3D thermal splat of it.
  • Report page: a static page with a map of the track, the mission, heat sources and orbits, and links to each orbit's splat and thermal video. Leaflet 1.9.4 is included for the map.
  • Admin web UI: starts and stops monitoring of an entry and shows the monitor's state and the splat jobs. Logins are SupportProxy entries, checked against keys.tdb opened read-only.

The service only reads files. It makes no MAVLink connection and has no way to send to the vehicle. The monitor's systemd unit has no network, and only the jobs unit can read the GPU servers' ssh key. On a GPU server that key can run only the job agent, which fixes the pipeline and its limits.

Nothing changes in the proxy itself. Setup is described in flightreport/README.md.

Testing

  • tests/test_flightreport.py: 50 tests pass. They cover the parts separately and the whole chain on a synthetic flight, with a stand-in for the splat tools. numpy is added to the CI setup for them.
  • Replayed the recordings of a real flight (tlog and raw thermal segments) through the monitor and the report page locally.

Not tested

  • The tests do not run the real splat pipeline on a GPU.

@tridge tridge added the AIReview Request an automated AI review; picked up by the reviewprs sweep label Dec 3, 2026
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: REQUEST CHANGES

Reviewed at head 282f5d0460.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/supportproxy/61/1.html#prSupportProxy-61

This draft adds a lot of well-separated, well-tested code, but four verified defects block it: results lost on unpublish, a bad waypoint file stopping all publishing, a wrong public-video notice and threshold changes ignored after a flight.

Blocking

  1. flightreport/publish.py:329 Unpublishing deletes the only copy of splats and orbit clips (results of flights started unpublished are lost too), yet the job stays "ready" and republishing links to missing files. Keep job results outside public_root and copy them in.
  2. flightreport/mission.py:64 A waypoint file with nan/inf is accepted; json.dumps(allow_nan=False) then raises out of publish_changed() and JobRunner.run(), stopping publishing for every flight and the jobs service on each restart. Reject non-finite values and catch errors per flight.
  3. flightreport/web/templates/index.html:52 The start form says a published report excludes the rest of the video, but publish_video defaults on and the whole flight's video, RGB included, is published. Make the notice match, or add a video choice.
  4. flightreport/supervisor.py:17 Changing the threshold or orbit modes of an ended flight starts no replay, despite the README; hidden hotspots are cleared and the report shows the new threshold next to the old hotspots. Start a monitor when the settings differ from the ones the last replay used.

Should fix

  • flightreport/jobs.py:295 An OSError while staging or copying a finished splat (e.g. ENOSPC) escapes step(), leaves the job running, re-fetches it after restart and skips publishing. Fail or defer the job instead.
  • flightreport/monitor.py:412 Every replay deletes saved hotspots/detections before reading the tlog, so if retention has removed it, a later "Make again" wipes the heat sources. Rebuild into temporary state or keep the old rows.
  • flightreport/monitor.py:354 Field of view comes from the recording only after the backlog has been projected, so replayed and from-start reports place hotspots with the default 24.2 degree FOV (32 m off in the test). Load the recording metadata first.
  • flightreport/recordings.py:65 Recording names are parsed as server local time, but entries with KEY_FLAG_USE_TZ are named with their own offset, so their video can drop out of the flight.

Low

  • flightreport/jobs.py:194 An "unknown" job is re-uploaded on the main loop (up to 1800 s), stalling following, health checks and publishing. Requeue it or use the upload thread.
Minor (3)

Reads an entry's tlog and raw thermal recordings as the proxy writes
them. Records the camera's own detections (DATA96 type 68) and hotspots
above a threshold (CAMERA_THERMAL_RANGE projected to the ground), finds
orbits from the flight modes, and cuts the thermal video of each orbit.

File access only: there is no MAVLink connection and no way to send.
The job runner sends an orbit's thermal video to a GPU server over ssh
and follows the job. On the server the service's key can run only the
job agent, which fixes the pipeline and its limits.
A static page with a map of the track, mission, heat sources and orbits,
and links to each orbit's splat and thermal video. Its data is rewritten
as the flight goes on. Leaflet 1.9.4 is included for the map.
Starts and stops monitoring of an entry and shows the monitor's state
and the splat jobs. Logins are SupportProxy entries, checked against
keys.tdb opened read-only.
The monitor unit has no network. Only the jobs unit can read the GPU
servers' ssh key.
Unit tests and the whole chain on a synthetic flight with a stand-in for
the splat tools. numpy is added to the CI setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIReview Request an automated AI review; picked up by the reviewprs sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants