Repository navigation
Conversation
🔎 Flash and RAM Analysis
px4_io-v2 firmware image, which an FMU flashes to its IO at boot: unchanged. px4_fmu-v2 — Bloaty section/symbol breakdownpx4_fmu-v5x — Bloaty section/symbol breakdownpx4_fmu-v6x — Bloaty section/symbol breakdownpx4_io-v2 — Bloaty section/symbol breakdownUpdated: 2026-11-26T06:15:55 |
|
No broken links found in changed files. |
JonasPerolini
left a comment
There was a problem hiding this comment.
Thanks @anilkir, this indeed fixes the race. I reproduced it in SIH:
- on main the failsafe triggers at the Home crossing, 0.3 s before Navigator switches to the rally point.
- With this PR it triggers 110 s later, when the rally point drops out of reach.
My concern is how much change a second time estimate needs and the fact that it uses RTLDirect to do it. That comes from how RTL is structured today, not from your PR:
- The estimate is a method of the executor and reads its configuration (
_destination,_land_approach,_rtl_alt). To estimate a destination,estimateDirectReturn()has to configure RtlDirect for it, andapplyReturn()has to configure it again right after. - The avoidance path belongs to the one destination the planner holds, and the estimate always adds it. So the rally point is estimated along Home's path.
- 3 different asks:
- The selection wants "what if" estimates
- the GCS wants the Return that will be flown
- the failsafe wants the lowest. The third has no natural place, so it became the
_alternative_safe_time_estimatemember.
If that's ok with you, I'd open a small refactor PR first:
RtlDirect::estimateReturnTo(target)estimates any destination without configuringRtlDirect.on_inactive()writes out select, apply and publish, so the second estimate can stay a local passed to the publisher.
Your PR would then only add the field, fill it in selectHomeIfReachable(), and use it in the publisher and in commander.
|
Created #30006 as a first step to simplify this PR. |
|
Hey @anilkir just a heads up that both small PRs have been merged. Thanks for the feedback in each! |
Signed-off-by: Anil Kircaliali <anil.kircaliali@auterion.com>
94c65de to
eac17f5
Compare
|
@JonasPerolini updates are captured in eac17f5 after rebasing on main with your changes |
JonasPerolini
left a comment
There was a problem hiding this comment.
Thanks @anilkir,
One functional point is left: with a geofence between the vehicle and Home, the rally point fallback estimation follows Home's detour and gets dropped, so the race this PR fixes comes back.
Feel free to discard the Nit comments.
Solved Problem
With
RTL_TYPE=6the distance-aware return failsafe no longer triggers Return when Home drops out of battery reach while a rally point is still within reach.rtl_time_estimategets a new fieldmin_safe_time_estimatewhich commander compares with the remaining flight time.Type 6 selects Home or a rally point based on energy budget so the estimate it publishes for the selected destination drops when Home goes out of reach. Navigator re-selects every 2s but commander compares that estimate with battery's remaining time estimate every 100ms. At the Home crossing commander sees the Home estimate above the remaining flight time and triggers Return before navigator has switched to the rally point.
Solution
With
RTL_TYPE=6,Return only has to start once neither Home nor the rally point is within reach. Navigator now publishes the lower of those two time estimates asmin_safe_time_estimateand commander compares the remaining flight time with that value instead ofsafe_time_estimate. Unlike the estimate to the selected destination, it does not change when Home drops out of reach, so the failsafe no longer triggers at that moment.safe_time_estimatedescribes the Return that would start now.Not part of this PR, implemented by #29998:
min_safe_time_estimatebecomes the lowest over Home and all rally points.Changelog Entry
For release notes:
Alternatives
Test coverage
Context
Related links, screenshot before/after, video