ArduPilot / ArduPilot/ardupilot
Pose jump after source switching OPT_FLOW->EXT_NAV(Tertiary->Secondary) after EXT_NAV reset
- Dominant language
- C++
- Stars
- 15.9k
- Forks
- 21.4k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 119
Description
## Bug report
**Issue details**
While trying to handle EXT_NAV(VIO) source resets during mission execution by using EKF Source Switching, I notice an abrupt pose jump while switching from OPT_FLOW->EXT_NAV after EXT_NAV source reset in LOITER and GUIDED modes.
**Sources list:**
* Primary: GPS
* Secondary: EXTNAV(VIO)
* Tertiary: OPT_FLOW

**Workflow**
I'm using custom LUA scipt to do manual source switching, trying to mimic the resets and source switching workflow. I manually switched from GPS->EXTNAV before starting the mission. When EXTNAV resets(0,0,0,0,0,0) we switch from EXTNAV->OPT_FLOW. Once EXT_NAV becomes healthy, we switch back from OPT_FLOW->EXTNAV. The aim is to automatically switch between sources when needed using LUA script. Reference: [ahrs-source.lua](https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/ahrs-source.lua)
Help is much appreciated in understanding this behaviour. @rmackay9 @priseborough
**Version**
4.1.5
**Platform**
[ ] All
[ ] AntennaTracker
[X] Copter
[ ] Plane
[ ] Rover
[ ] Submarine
**Airframe type**
Quadcopter(IRIS copter)
**Hardware type**
Gazebo SITL Ubuntu 18.04
**Logs**
[log.zip](https://github.com/ArduPilot/ardupilot/files/11650687/log.zip)
**Video**
[video link](https://mega.nz/file/xqMgGBTJ#MoXnW0qDA1VALphnXjfpnDoGXimGTAHN82A_kD_3KT0)
Contributor guide
Research direction
Start by reviewing the linked ahrs-source.lua example and the attached log.zip and video, focusing on the OPT_FLOW→EXTNAV transition after reset in LOITER and GUIDED modes. Trace the source-switching implementation; no specific source file or test is named. Done means the pose jump is reproduced and its cause or a verified correction is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- embedded-iot, robotics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100