Files
PX4-Autopilot/test
Roman Bapst ee7134681d fix(navigator): keep established loiter on RTL/Hold and let each mode own its triplet reset (#27836)
* fix(navigator): remove generic reset of navigator triplets on mode change

- make each navigation mode decide if it needs the reset and what data it
wants to capture before the reset
- fix RTL climbing so that it remains on an established loiter when RTL
is being activated -> avoids weird trajectories and potential geofence breaches

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* feat(mavsdk_tests): added various integration tests for loitering behavior:

- make sure RTL climb remains on established loiter
- make sure new loiter at current location is set when HOLD is engaged while
vehicle is transiting to another loiter
- make sure altitude is locked to current altitude when vehicle is currently
flying an established loiter but is transiting to a higher altitude
- make sure vehicle resets from figure of 8 to a loiter when HOLD is engaged
while vehicle is established on a figure of 8

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* navigator: improve wording

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* rtl_mission_direct_land: avoid loitering on a previously set figure of 8

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* fix(navigator): harden geofence position checks and preserve loiter on breach

The GF_SOURCE_GPS path previously gated the breach check on the global
position timestamp even though it evaluated the fence against raw GPS
coordinates. Validate each source against the data it actually uses:
the fused global position on freshness (<1s), and raw GPS on freshness
(<2s) plus a valid fix.

For the LOITER breach action, only issue the reposition when the fused
global position is valid, since the setpoint is flown on that estimate,
and source all reposition coordinates from it. When the vehicle is
already established on a circular (orbit) loiter, keep that loiter's
center instead of re-centering on the current position to avoid a jump.

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* fixup

Signed-off-by: RomanBapst <bapstroman@gmail.com>

* make methods const

Signed-off-by: RomanBapst <bapstroman@gmail.com>

---------

Signed-off-by: RomanBapst <bapstroman@gmail.com>
2026-07-16 18:07:04 +03:00
..