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

fix(fw_latlon_control): prevent NaN eas2tas from zero-airspeed division by mahima-yoga · Pull Request #28107 · PX4/PX4-Autopilot · GitHub

fix(fw_latlon_control): prevent NaN eas2tas from zero-airspeed division - #28107

Merged
mahima-yoga merged 1 commit into
mainfrom
fix-nan_eas2tas
Jul 30, 2026
Merged

mahima-yoga merged 1 commit into
mainfrom
fix-nan_eas2tas

Conversation

mahima-yoga commented Jul 29, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Solved Problem

Before takeoff, if TAS = CAS = 0, the eas2tas conversion computed in the FwLateralLongitudinalControl module becomes NaN. This then results in a NAN TAS, the TECS STE filter doesn't recover from that, and the throttle goes to zero.

Part of the TECS nan propogation issue (the pitch part) was fixed here, but wasn't flown in the above case. Throttle part not addressed yet.

Solution

If CAS < FLT_EPSILON, keep the previous eas2tas.

Changelog Entry

For release notes:

Feature/Bugfix  prevent NaN eas2tas from zero-airspeed division in fixedwing controller

Alternatives

The real solution for all of these cases would be to not allow a NaN measurement into the filter and/or reset it if it does enter. While I do that though, this fixes the immediate issue and I would like to get this in.

github-actions Bot added kind:bug Something is broken or behaving incorrectly. vehicle:fixed-wing Fixed-wing-specific behavior. scope:control Rate, attitude, position, allocation, or actuator control. labels Jul 29, 2026
mahima-yoga requested a review from sfuhrer July 29, 2026 13:36
mahima-yoga assigned mbjd and unassigned mbjd Jul 29, 2026
mahima-yoga requested a review from mbjd July 29, 2026 13:37

github-actions Bot commented Jul 29, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 16 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +16  +0.0%     +16    .text
    +8.2%     +16  +8.2%     +16    FwLateralLongitudinalControl::updateAirspeed()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  -0.0%      -2  [ = ]       0    .debug_info
  -0.0%      -5  [ = ]       0    .debug_line
  +0.0%      +5  [ = ]       0    .debug_loclists
  -0.0%      -1  [ = ]       0    .debug_rnglists
    +200%      +2  [ = ]       0    [Unmapped]
    -0.0%      -3  [ = ]       0    [section .debug_rnglists]
  -0.2%     -16  [ = ]       0    [Unmapped]
  +0.0%     +52  +0.0%     +16    TOTAL

px4_fmu-v6x [Total VM Diff: 16 byte (0 %)]
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%     +16  +0.0%     +16    .text
    +8.2%     +16  +8.2%     +16    FwLateralLongitudinalControl::updateAirspeed()
  +0.0%     +55  [ = ]       0    .debug_abbrev
  -0.0%      -2  [ = ]       0    .debug_info
  -0.0%      -5  [ = ]       0    .debug_line
  -0.0%      -4  [ = ]       0    .debug_rnglists
   -33.3%      -1  [ = ]       0    [Unmapped]
    -0.0%      -3  [ = ]       0    [section .debug_rnglists]
  -0.3%     -16  [ = ]       0    [Unmapped]
  +0.0%     +44  +0.0%     +16    TOTAL

Updated: 2026-07-30T10:09:10

mahima-yoga merged commit 1539a75 into main Jul 30, 2026
78 of 79 checks passed
mahima-yoga deleted the fix-nan_eas2tas branch July 30, 2026 12:10
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. scope:control Rate, attitude, position, allocation, or actuator control. vehicle:fixed-wing Fixed-wing-specific behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL