Conversation
dakejahl
left a comment
There was a problem hiding this comment.
It makes sense to me and seems like a good feature. On a side note, we need to start adding CI SITL tests for all of these behaviors.
@dakejahl thanks for the feedback. I pushed a |
a1dbebc to
7a96a6e
Compare
|
|
|
Remember to do docs for this when it goes in, and also update the release note in https://docs.px4.io/main/en/releases/main |
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 424 byte (0.02 %)]px4_fmu-v6x [Total VM Diff: 376 byte (0.02 %)]Updated: 2026-04-27T02:34:18 |
|
SIH CI: EDIT:
I think we should leave this as a follow-up to simulate the current properly in BatterySimulator and then I can add CI for these tests as well. Let me know if you're ok with this @dakejahl Docs: EDIT: |
…ability condition
…home or rally) point.
c4738af to
4d36039
Compare
|
/en/flight_modes/return.md
|
hamishwillee
left a comment
There was a problem hiding this comment.
Approved for the docs (thanks!). I subedited a little. This replaces my unreviewed stuff in #26783
sfuhrer
left a comment
There was a problem hiding this comment.
The code looks clean and I agree with it being useful. Would consider making it the MC default (either now or once we have a bit more testing).
Co-authored-by: Silvan Fuhrer <silvan@auterion.com>
Solved Problem
There are real-life scenarios where an RTL to home position may be preferable to an RTL to a rally point. The idea is to introduce a layer of prioritization where a return to home point is prioritized over a return to one of the rally points as long as it is reachable in the remaining flight time.
Currently, PX4 does not support a hybrid RTL strategy that prioritizes returning to home while falling back to rally points based on actual remaining flight time.
Solution
Adds
RTL_TYPE 6: a new RTL type that selects the return destination based on battery time remaining. If the estimated flight time to home is within the battery'stime_remaining_s, home is chosen. Otherwise, the closest rally point is selected as the fallback destination. If an RTL is triggered whentime_remaining_sisNaN, then the closest of home or rally points is selected (identical toRTL_TYPE=0behavior).This RTL type is particularly useful for long-range operations where rally points are pre-positioned as intermediate safe landing zones, but home is always preferred when battery permits.
Assumptions:
time_remaining_sisNaNand the RTL estimate check is not able to trigger an RTL when the closest safe point is farther than the remaining flight time, we will rely on the CRITICAL and EMERGENCY battery level threshold failsafes with potentiallyKey changes:
Added RTL_TYPE 6 case to the RTL module's destination selection logic
Reuses existing rally point and home reachability infrastructure
Uses battery_status.time_remaining_s to evaluate home reachability at the time of RTL trigger
Changelog Entry
For release notes:
Test coverage
RTL triggered byBAT_CRIT_THRflag when all safe points are out of reach (SITL)time_remaining_sfield has aNaNand home is the closest of safe points (SITL)time_remaining_sfield has aNaNbut home is not the closest of safe points (SITL)Video showing preference of home position within reach over a closer rally point:
home_preferred_comp.mp4