FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(navigator): keep a VTOL in multicopter mode through mission RTL by Saibernard · Pull Request #28399 · PX4/PX4-Autopilot · GitHub

fix(navigator): keep a VTOL in multicopter mode through mission RTL - #28399

Merged
dakejahl merged 2 commits into
PX4:mainfrom
Saibernard:fix/vtol-rtl-mission-land-transition
Sep 3, 2026
Merged

dakejahl merged 2 commits into
PX4:mainfrom
Saibernard:fix/vtol-rtl-mission-land-transition

Conversation

Saibernard commented Aug 27, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

An MC-mode VTOL can now enter its planned mission landing without an unnecessary forward transition. The same applies to the fast and the reverse mission RTL. A VTOL that enters RTL in multicopter mode flies it as a multicopter, the same as direct RTL.

Problem

Direct mission-land RTL forced MC-mode VTOLs into fixed-wing mode at return altitude. The vehicle could remain armed instead of starting the landing sequence.

Solution

Preserve the current VTOL mode and advance directly to DO_LAND_START. The fast and the reverse mission RTL carried the same transition request, which the VTOL attitude controller rejects during RTL, so it is removed there as well, with a unit test and a SITL flight for each mode. This addresses the forced-transition behavior in #27817 and #24323; the separate invalid-mission race in #27817 remains out of scope.

github-actions Bot added kind:bug Something is broken or behaving incorrectly. kind:test Adds or improves tests. scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. scope:testing Unit, integration, fuzzing, or test data. labels Aug 27, 2026

github-actions Bot commented Aug 27, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: -160 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +47  [ = ]       0    .debug_abbrev
  -0.0% -2.61Ki  [ = ]       0    .debug_info
  -0.0%    -314  [ = ]       0    .debug_line
     +40%      +2  [ = ]       0    [Unmapped]
    -0.0%    -316  [ = ]       0    [section .debug_line]
  -0.0%     -48  [ = ]       0    .debug_loclists
  -0.0%      -8  [ = ]       0    .debug_rnglists
  +1.5%    +160  [ = ]       0    [Unmapped]
  -0.0%    -160  -0.0%    -160    .text
     +11%      +4   +11%      +4    Takeoff::on_activation()
    -4.2%     -48  -4.2%     -48    RtlDirectMissionLand::setActiveMissionItems()
   -14.9%     -52 -14.9%     -52    RtlMissionFastReverse::setActiveMissionItems()
   -11.4%     -64 -11.4%     -64    RtlMissionFast::setActiveMissionItems()
  -0.0% -2.93Ki  -0.0%    -160    TOTAL

px4_fmu-v6x [Total VM Diff: -160 byte (-0.01 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +47  [ = ]       0    .debug_abbrev
  -0.0% -2.61Ki  [ = ]       0    .debug_info
  -0.0%    -314  [ = ]       0    .debug_line
     +40%      +2  [ = ]       0    [Unmapped]
    -0.0%    -316  [ = ]       0    [section .debug_line]
  -0.0%     -48  [ = ]       0    .debug_loclists
  -0.0%      -8  [ = ]       0    .debug_rnglists
  +2.3%    +160  [ = ]       0    [Unmapped]
  -0.0%    -160  -0.0%    -160    .text
     +11%      +4   +11%      +4    Takeoff::on_activation()
    -4.2%     -48  -4.2%     -48    RtlDirectMissionLand::setActiveMissionItems()
   -14.9%     -52 -14.9%     -52    RtlMissionFastReverse::setActiveMissionItems()
   -11.4%     -64 -11.4%     -64    RtlMissionFast::setActiveMissionItems()
  -0.0% -2.93Ki  -0.0%    -160    TOTAL

Updated: 2026-09-02T22:57:33

Saibernard closed this Aug 27, 2026
Saibernard reopened this Aug 27, 2026
Saibernard force-pushed the fix/vtol-rtl-mission-land-transition branch 2 times, most recently from d5629fe to e13d589 Compare August 28, 2026 00:46
mahima-yoga requested a review from mbjd September 2, 2026 11:07

mbjd left a comment
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This makes sense, I guess expected behaviour is then

  • any type of mission RTL while in fixed-wing - do the mission RTL as it would be in FW
  • any type of mission RTL while in MC - do the entire RTL in MC

If we are kilometers away from home it makes little sense to start a long mission without front-transition. I guess the alternative solving that would be:

  • remove/weaken said vtol_att_control_main snippet and allow the transitions.
  • modify rtl direct to include such a front-transition only if far enough for it to be worthwhile (I think at the moment it does the entire RTL as a multicopter)

Did you consider and reject this alternative?

  • If yes this is good to go after removing the other, equally broken snippets. Please outline the reason for rejecting the alternative then :)
  • If not, could you consider if the alternative reaches the goal in a simpler way while allowing sensible RTL from far away while in MC mode?

Thanks a lot in any case!

Remove the unconditional multicopter-to-fixed-wing transition from direct mission-land RTL so the return uses the VTOL mode active when RTL starts. This allows an MC-mode vehicle to proceed through the mission landing sequence instead of becoming stuck after an unnecessary forward transition.

Add module-level and MAVSDK SITL regressions covering an airborne multicopter-mode VTOL with a planned mission landing.

Refs PX4#27817

Refs PX4#24323

Assisted-by: Codex:gpt-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
…s too

The fast and the reverse mission RTL carried the same request for a
transition to fixed wing as the direct mission land RTL. The VTOL
attitude controller rejects that command during RTL, so a VTOL in
multicopter mode waited on it forever instead of flying the mission.
Remove both. A VTOL in multicopter mode now flies the mission RTL as a
multicopter, the same as direct RTL does. Reported in PX4#24323.

Two unit tests pin the active item to a waypoint for a VTOL in
multicopter mode, and two MAVSDK cases fly it on the standard VTOL in
SIH: the mission landing and the reverse mission both stay in
multicopter mode to touchdown, within 5 m of the land item and of home.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
Saibernard force-pushed the fix/vtol-rtl-mission-land-transition branch from e13d589 to e9d0895 Compare September 2, 2026 22:47
Saibernard changed the title fix(navigator): preserve VTOL mode in direct mission RTL fix(navigator): keep a VTOL in multicopter mode through mission RTL Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look. The other two snippets are the same code, and the attitude controller has been refusing MC to FW transitions in RTL since 2020, so all three ask for something that can never happen and the navigator just waits on it. I removed them as well and added a unit test and a SITL flight for each mode. The vehicle stays a multicopter through the mission landing and through the reverse mission.

I did not go down the road of allowing a transition during RTL. I kept the change small because it makes mission RTL do what direct RTL already does for a VTOL in MC, which is the whole return in MC, and it removes a path that cannot complete. A distance based front transition would help on long returns, but it means weakening the transition block in the attitude controller and deciding when to transition and what to do if it fails. That felt bigger than this fix, so I left it out. If you think it is worth doing I can open a separate PR for it once this one is in.

mbjd self-requested a review September 3, 2026 07:28

mbjd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Makes sense, I agree with this fix.

Being in MC but far away from home is a rare enough edge case that we don't need to fix it right here right now. Entering RTL in MC will now fly the entire RTL in MC rather than not at all, which is a clear improvement.

We can take care of a more nuanced implementation (transition if too far to fly in MC) in a next step.

dakejahl merged commit 290f56d into PX4:main Sep 3, 2026
70 of 72 checks passed
mbjd pushed a commit that referenced this pull request Sep 4, 2026
…28399)

* fix(navigator): preserve VTOL mode in direct mission RTL

Remove the unconditional multicopter-to-fixed-wing transition from direct mission-land RTL so the return uses the VTOL mode active when RTL starts. This allows an MC-mode vehicle to proceed through the mission landing sequence instead of becoming stuck after an unnecessary forward transition.

Add module-level and MAVSDK SITL regressions covering an airborne multicopter-mode VTOL with a planned mission landing.

Refs #27817

Refs #24323

Assisted-by: Codex:gpt-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

* fix(navigator): drop the fixed wing transition from the fast RTL modes too

The fast and the reverse mission RTL carried the same request for a
transition to fixed wing as the direct mission land RTL. The VTOL
attitude controller rejects that command during RTL, so a VTOL in
multicopter mode waited on it forever instead of flying the mission.
Remove both. A VTOL in multicopter mode now flies the mission RTL as a
multicopter, the same as direct RTL does. Reported in #24323.

Two unit tests pin the active item to a waypoint for a VTOL in
multicopter mode, and two MAVSDK cases fly it on the standard VTOL in
SIH: the mission landing and the reverse mission both stay in
multicopter mode to touchdown, within 5 m of the land item and of home.

Assisted-by: Claude:claude-fable-5
Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>

---------

Signed-off-by: Saibernard Yogendran <bernie97@seas.upenn.edu>
(cherry picked from commit 290f56d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:bug Something is broken or behaving incorrectly. kind:test Adds or improves tests. scope:navigation Missions, RTL, geofence, takeoff, landing, or navigator behavior. scope:testing Unit, integration, fuzzing, or test data.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL