Skip to content

feat(log-analysis): add Plane landing analysis - #2024

Open
nflyernz wants to merge 10 commits into
ArduPilot:masterfrom
nflyernz:plane-landing-analysis
Open

feat(log-analysis): add Plane landing analysis#2024
nflyernz wants to merge 10 commits into
ArduPilot:masterfrom
nflyernz:plane-landing-analysis

Conversation

@nflyernz

@nflyernz nflyernz commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds ArduPlane 4.7.x landing analysis to AMC using the existing
log-analysis architecture and flat result model.

The implementation is based on the validated landing behavior from
ArduPilotTools (APT), migrated onto AMC-native:

  • LogData
  • LogAnalysisContext
  • PlaneFlightSegmentDetector
  • ParameterHistory
  • availability/analysis registry
  • flat LogAnalysisResult findings

No Plane-specific backend orchestration or frontend path is introduced.

Scope

Initial support is intentionally limited to ArduPlane 4.7.x.

Required evidence:

  • GPS
  • LAND
  • MODE
  • BARO

Optional evidence:

  • ARSP
  • RFND
  • CMD
  • MSG

The subsystem also requires at least one operational Plane flight segment.

Landing attempt detection

Supports:

  • multiple landing attempts within one flight
  • aborted/restarted approaches
  • go-arounds without splitting the parent flight
  • AUTO landing-stage detection
  • GPS-stop termination
  • abort-message termination
  • mode-exit termination
  • disarm termination
  • parent flight-segment termination

Across the four established APT regression logs:

  • 10 operational flights
  • 16 landing attempts
  • 16/16 attempt boundaries and associations match the validated APT behavior

Landing evidence

Adds objective flat findings for:

  • LAND stage 2 preflare timing/height
  • LAND stage 3 flare timing/height
  • preflare/flare GPS speed
  • ARSP evidence where available
  • BARO altitude and preflare sink rate
  • RFND stage-point evidence
  • event-time landing parameters using ParameterHistory
  • firmware landing glide-slope messages
  • firmware flare altitude/sink/airspeed/distance
  • flare-to-GPS-stop duration

Firmware comparison against the reference logs:

  • 16/16 glide-slope events match
  • 14/14 firmware flare events match

Mission LAND target evidence

Implements conservative CMD snapshot reconstruction matching APT:

  • complete ordered mission snapshots only
  • latest complete snapshot applicable at attempt start
  • exactly one MAV_CMD_NAV_LAND
  • malformed/incomplete/ambiguous mission state rejected
  • independently computed GPS-stop to mission LAND-target distance

Reference comparison:

  • 16/16 mission LAND-target selections match APT
  • 3/3 computed target distances match APT

Rangefinder lifecycle evidence

Adds the validated APT RFND lifecycle evidence:

  • first nonzero sample
  • first in-range sample
  • continuous acquisition
  • disengagement count
  • last disengagement

All nine RFND lifecycle fields match across all 16 reference landing attempts.

RFND remains optional.

AMC-specific correctness

Landing GPS consumers use AMC's existing active-receiver convention:

  • if GPS.U exists, only U == 1 is used
  • otherwise all GPS records are used

Event-time landing parameter findings also reject non-finite values rather
than emitting NaN/Inf evidence.

Architecture

Follows ARCHITECTURE_log_analysis.md and the documented
"Extending the Log Analysis System" path.

The PR:

  • uses existing LogData and LogAnalysisContext
  • uses the existing Plane flight segmentation infrastructure
  • uses shared ParameterHistory
  • registers the Plane landing subsystem through the existing registry
  • emits existing flat analysis results
  • makes no extraction/backend/frontend architecture changes

Deliberately out of scope

Not included in this PR:

  • touchdown detection
  • post-attempt rollout evidence
  • firmware Distance from LAND point=...
  • widening completed FlightSegments
  • runway/cross-track/along-track geometry
  • qualitative landing scoring
  • parameter recommendations
  • Plane landing configuration-step/frontend changes
  • hierarchical per-flight/per-attempt results
  • firmware support outside ArduPlane 4.7.x

Validation

Final applicable non-SITL AMC test run:

  • 4901 passed
  • 55 skipped
  • 4 xfailed

Additional validation:

  • focused Plane landing tests pass
  • APT landing regression passes
  • APT event/timeline regression passes
  • Ruff lint passes
  • Ruff format check passes
  • changed-file mypy passes
  • changed-file pylint 10.00/10
  • git diff --check passes

@coveralls

coveralls commented Sep 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 33926127272

Coverage increased (+0.1%) to 89.446%

Details

  • Coverage increased (+0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 12 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

12 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
log_analysis/data_model_log_analysis.py 12 89.34%

Coverage Stats

Coverage Status
Relevant Lines: 19717
Covered Lines: 17636
Line Coverage: 89.45%
Relevant Branches: 5942
Covered Branches: 4911
Branch Coverage: 82.65%
Branches in Coverage %: No
Coverage Strength: 2.66 hits per line

💛 - Coveralls

Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
Signed-off-by: nflyernz <319460892+nflyernz@users.noreply.github.com>
@nflyernz
nflyernz force-pushed the plane-landing-analysis branch from 0b76609 to 0178029 Compare September 4, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants