Ticket 063 — Return-to-Home Reserve Check from Worst-Case Point¶
Status: Implemented¶
Problem¶
The current energy feasibility model computes reserve at the planned landing point (the last route item). For real BVLOS approval a more important question is: at every point along the route, does the vehicle have enough battery to fly straight home AND land with reserve intact?
Today there is no way to answer "can I RTH from waypoint 5 with reserve?" without manually running a scenario with a lost-link event. This is the single most common pre-flight question asked by real operators.
Acceptance Criteria¶
EnergyEstimategains an optionalrth_reserve_timelinefield: a list of per-leg RTH margin values (energy remaining after hypothetical RTH from that leg's endpoint minus reserve threshold).- The RTH distance from each leg endpoint to
mission.planned_homeis computed geodesically (straight-line, same as landing-zone divert). - RTH energy uses TAS-based cruise-power calculation (same model as landing-zone divert; wind correction from Ticket 062 can be applied later).
MissionEstimateexposes a newrth_is_feasibleboolean: true iff the vehicle can RTH from every leg with reserve intact.- The Markdown report includes an "RTH Reserve Timeline" table.
- The GeoJSON export colours each leg by RTH margin (green/yellow/red).
- At least 6 tests cover: feasible RTH at all legs, infeasible RTH at one intermediate leg, short mission that is always feasible, missing home position handling.
- Existing tests are unaffected (opt-in;
rth_reserve_timelineis None when not computed, i.e., whenmission.planned_homeis absent).
Scope¶
estimator/core/results.py—EnergyEstimate.rth_reserve_timelineestimator/execution/energy.py— RTH distance + energy per legadapters/markdown.py— RTH sectionadapters/geojson_export.py— RTH margin layerdocs/USAGE.md— document new output fieldtests/test_estimator_energy.py— new RTH tests
Notes¶
planned_homeis always present inMissionPlan; the planned home position is the RTH destination.- This feature directly replaces the need to run a full scenario just to answer "can I RTH at any point?"