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

fix(fw_lat_lon_control): use tailsitter fixed-wing heading by UnderMind0x41 · Pull Request #28656 · PX4/PX4-Autopilot · GitHub

fix(fw_lat_lon_control): use tailsitter fixed-wing heading - #28656

Merged
mbjd merged 1 commit into
PX4:mainfrom
UnderMind0x41:fix/tailsitter-guidance-heading-frame
Sep 10, 2026
Merged

mbjd merged 1 commit into
PX4:mainfrom
UnderMind0x41:fix/tailsitter-guidance-heading-frame

Conversation

UnderMind0x41 commented Sep 10, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Solved Problem

Fixes #28643.

Fixed-wing modules were using raw vehicle_local_position.heading where the already frame-adapted _yaw was needed. On tailsitters this can invert heading relative to ground track and affect backtransition heading hold.

Solution

Use _yaw in the no-wind guidance-quality check and when capturing the no-position backtransition heading. This is a two-line change.

Test coverage

github-actions Bot added kind:bug Something is broken or behaving incorrectly. vehicle:fixed-wing Fixed-wing-specific behavior. kind:test Adds or improves tests. scope:control Rate, attitude, position, allocation, or actuator control. scope:testing Unit, integration, fuzzing, or test data. labels Sep 10, 2026

github-actions Bot commented Sep 10, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 32 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +32  +0.0%     +32    .text
    +6.1%     +16  +6.1%     +16    FwLateralLongitudinalControl::getGuidanceQualityFactor()
    +3.0%      +8  +3.0%      +8    FwLateralLongitudinalControl::getCorrectedLateralAccelSetpoint()
    +4.3%      +4  +4.3%      +4    FixedWingModeManager::control_backtransition_heading_hold()
    +0.5%      +4  +0.5%      +4    FixedWingModeManager::vehicle_attitude_poll()
  +0.0%     +26  [ = ]       0    .debug_abbrev
  -0.0%      -8  [ = ]       0    .debug_aranges
  -0.0%     -12  [ = ]       0    .debug_frame
  -0.0%    -162  [ = ]       0    .debug_info
  -0.0%     -16  [ = ]       0    .debug_line
    +300%      +3  [ = ]       0    [Unmapped]
    -0.0%     -19  [ = ]       0    [section .debug_line]
  -0.0%    -116  [ = ]       0    .debug_loclists
     +50%      +1  [ = ]       0    [Unmapped]
    -0.0%    -117  [ = ]       0    [section .debug_loclists]
  +0.0%     +21  [ = ]       0    .debug_rnglists
  -0.0%      -1  [ = ]       0    .debug_str
  -0.4%      -1  [ = ]       0    .shstrtab
  -0.0%      -7  [ = ]       0    .strtab
    -7.1%      -7  [ = ]       0    FwLateralLongitudinalControl::getGuidanceQualityFactor()
   -40.0%     -16  [ = ]       0    __hrt_call_enter_veneer
     +62%     +16  [ = ]       0    __perf_set_elapsed_veneer
  -0.3%     -32  [ = ]       0    [Unmapped]
  -0.0%    -276  +0.0%     +32    TOTAL

px4_fmu-v6x [Total VM Diff: 32 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +32  +0.0%     +32    .text
    +6.1%     +16  +6.1%     +16    FwLateralLongitudinalControl::getGuidanceQualityFactor()
    +3.0%      +8  +3.0%      +8    FwLateralLongitudinalControl::getCorrectedLateralAccelSetpoint()
    +4.3%      +4  +4.3%      +4    FixedWingModeManager::control_backtransition_heading_hold()
    +0.5%      +4  +0.5%      +4    FixedWingModeManager::vehicle_attitude_poll()
  +0.0%     +26  [ = ]       0    .debug_abbrev
  -0.0%      -8  [ = ]       0    .debug_aranges
  -0.0%     -12  [ = ]       0    .debug_frame
  -0.0%    -162  [ = ]       0    .debug_info
  -0.0%     -16  [ = ]       0    .debug_line
    +300%      +3  [ = ]       0    [Unmapped]
    -0.0%     -19  [ = ]       0    [section .debug_line]
  -0.0%    -120  [ = ]       0    .debug_loclists
    [DEL]      -3  [ = ]       0    [Unmapped]
    -0.0%    -117  [ = ]       0    [section .debug_loclists]
  +0.0%     +21  [ = ]       0    .debug_rnglists
  -0.0%      -1  [ = ]       0    .debug_str
  -0.4%      -1  [ = ]       0    .shstrtab
  -0.0%      -7  [ = ]       0    .strtab
    -7.1%      -7  [ = ]       0    FwLateralLongitudinalControl::getGuidanceQualityFactor()
  -0.7%     -32  [ = ]       0    [Unmapped]
  -0.0%    -280  +0.0%     +32    TOTAL

Updated: 2026-09-10T08:14:16

mbjd self-requested a review September 10, 2026 07:16

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

The fix looks correct, thank you very much. But I think it can be much simplified, achieving the same thing in a single line change (see comments). (what agent are you using? you might benefit from putting some focus on the simplest viable solution in the prompt or doing a simple review/simplify loop)

My LLM is saying that FixedWingModeManager::control_backtransition_heading_hold has the same bug, and I think it can also be fixed by swapping _local_pos.heading to _yaw coming from FixedWingModeManager::vehicle_attitude_poll. Would you mind checking that and doing that fix too if true?

Given that #27793 etc were almost the same bug, it might indeed pay to extract the conversions into a shared helper, certify their correctness with tests, and use consistently everywhere. But no need to do that here & now.

Use the fixed-wing-frame yaw already computed from vehicle attitude for the no-wind heading and track quality check. Use the same adapted yaw when capturing the no-position backtransition heading.

Assisted-by: Codex:gpt-5
Signed-off-by: Kirill <exxxim@gmail.com>
UnderMind0x41 force-pushed the fix/tailsitter-guidance-heading-frame branch from 9d700b1 to b3481ba Compare September 10, 2026 08:07
UnderMind0x41 requested a review from mbjd September 10, 2026 08: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

Thanks again :)

mbjd merged commit 3599328 into PX4:main Sep 10, 2026
74 checks passed
mbjd pushed a commit that referenced this pull request Sep 10, 2026
Use the fixed-wing-frame yaw already computed from vehicle attitude for
the no-wind heading and track quality check. Use the same adapted yaw
when capturing the no-position backtransition heading.

Assisted-by: Codex:gpt-5

Signed-off-by: Kirill <exxxim@gmail.com>
Co-authored-by: Kirill <exxxim@gmail.com>
(cherry picked from commit 3599328)
mrpollo pushed a commit that referenced this pull request Sep 10, 2026
Use the fixed-wing-frame yaw already computed from vehicle attitude for
the no-wind heading and track quality check. Use the same adapted yaw
when capturing the no-position backtransition heading.

Assisted-by: Codex:gpt-5

Signed-off-by: Kirill <exxxim@gmail.com>
Co-authored-by: Kirill <exxxim@gmail.com>
(cherry picked from commit 3599328)
mrpollo pushed a commit that referenced this pull request Sep 10, 2026
Use the fixed-wing-frame yaw already computed from vehicle attitude for
the no-wind heading and track quality check. Use the same adapted yaw
when capturing the no-position backtransition heading.

Assisted-by: Codex:gpt-5

Signed-off-by: Kirill <exxxim@gmail.com>
Co-authored-by: Kirill <exxxim@gmail.com>
(cherry picked from commit 3599328)
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:control Rate, attitude, position, allocation, or actuator control. scope:testing Unit, integration, fuzzing, or test data. vehicle:fixed-wing Fixed-wing-specific behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tailsitter: fw_lat_lon_control can disable lateral control by comparing ground track to MC-frame heading

2 participants


Back | FazBrowse Home | New Git URL