Skip to content

FixedWingLandDetector: force to landed during runway takeoff#26252

Merged
mahima-yoga merged 2 commits intomainfrom
pr-runway-takeoff-detection
Jan 14, 2026
Merged

FixedWingLandDetector: force to landed during runway takeoff#26252
mahima-yoga merged 2 commits intomainfrom
pr-runway-takeoff-detection

Conversation

@mahima-yoga
Copy link
Copy Markdown
Contributor

@mahima-yoga mahima-yoga commented Jan 12, 2026

Solved Problem

Takeoff detection occurs when the vehicle is !_landed. During a runway takeoff, it's possible that one of the conditions to be landed is no longer met and premature takeoff is detected. This unlocks the integrator and can start introducing unwanted control surface deflections.

Solution

As we do with hand/catapult launch detection, we can use the knowledge that we are in an auto-takeoff mode inside the land detector. This PR:

  • Adds the runway_takeoff_state to the FixedWingRunwayControl.msg
  • Renames the fixed_wing_runway_control_s::STATE_FLY to fixed_wing_runway_control_s::STATE_FLYING. I think it's nicer and then it's the same as the launch detection state.
  • Forces the vehicle to landed state to stay landed if runway_takeoff_state < fixed_wing_runway_control_s::STATE_CLIMBOUT
  • Some minor cleanup

Changelog Entry

For release notes:

Feature/Bugfix Force fixed-wing vehicle to landed during runway takeoff

Test coverage

Flight Test

With LNDFW_AIRSPD_MAX=6 and LNDFW_VEL_XY_MAX=5. We stay landed until the climbout phase.

image

SITL Tests:

  1. General takeoff test (log):
image
  1. Force runway_takeoff_state to CLAMPED_TO_RUNWAY in code (log):
image

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 12, 2026

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 112 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +112  +0.0%    +112    .text
  +6.5%     +34  +6.5%     +34    hrt_elapsed_time
   +10%     +28   +10%     +28    land_detector::FixedwingLandDetector::FixedwingLandDetector()
  +0.1%     +20  +0.1%     +20    uORB::compressed_fields
  +2.2%     +16  +2.2%     +16    FixedWingModeManager::control_auto_takeoff_no_nav()
  +0.9%     +12  +0.9%     +12    FixedWingModeManager::control_auto_takeoff()
  +0.0%      +8  +0.0%      +8    [section .text]
  +8.9%      +8  +8.9%      +8    land_detector::FixedwingLandDetector::~FixedwingLandDetector()
 -50.0%      -2 -50.0%      -2    land_detector::FixedwingLandDetector::_set_hysteresis_factor()
  -0.6%      -4  -0.6%      -4    FixedWingModeManager::vehicle_attitude_poll()
  -1.4%      -4  -1.4%      -4    px4::logger::Logger::~Logger()
  -0.4%      -4  -0.4%      -4    two_over_pi
+0.0%    +104  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +24  [ = ]       0    .debug_frame
+0.0%    +648  [ = ]       0    .debug_info
+0.0%    +136  [ = ]       0    .debug_line
  [DEL]      -1  [ = ]       0    [Unmapped]
  +0.0%    +137  [ = ]       0    [section .debug_line]
+0.0%     +78  [ = ]       0    .debug_loclists
-0.0%     -26  [ = ]       0    .debug_rnglists
  [DEL]      -1  [ = ]       0    [Unmapped]
  -0.0%     -25  [ = ]       0    [section .debug_rnglists]
+0.0%    +312  [ = ]       0    .debug_str
+0.0%     +32  [ = ]       0    .symtab
  +6.7%     +32  [ = ]       0    hrt_elapsed_time
  +100%     +16  [ = ]       0    land_detector::FixedwingLandDetector::_set_hysteresis_factor()
 -25.0%     -16  [ = ]       0    land_detector::MulticopterLandDetector::_get_ground_contact_state()
-1.3%    -112  [ = ]       0    [Unmapped]
+0.0% +1.29Ki  +0.0%    +112    TOTAL

px4_fmu-v6x [Total VM Diff: 112 byte (0.01 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +112  +0.0%    +112    .text
  +7.5%     +34  +7.5%     +34    hrt_elapsed_time
   +10%     +28   +10%     +28    land_detector::FixedwingLandDetector::FixedwingLandDetector()
  +0.1%     +20  +0.1%     +20    uORB::compressed_fields
  +2.2%     +16  +2.2%     +16    FixedWingModeManager::control_auto_takeoff_no_nav()
  +0.9%     +12  +0.9%     +12    FixedWingModeManager::control_auto_takeoff()
  +0.0%      +8  +0.0%      +8    [section .text]
  +8.9%      +8  +8.9%      +8    land_detector::FixedwingLandDetector::~FixedwingLandDetector()
 -50.0%      -2 -50.0%      -2    land_detector::FixedwingLandDetector::_set_hysteresis_factor()
  -0.6%      -4  -0.6%      -4    FixedWingModeManager::vehicle_attitude_poll()
  -1.4%      -4  -1.4%      -4    px4::logger::Logger::~Logger()
  -0.4%      -4  -0.4%      -4    two_over_pi
+0.0%    +104  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +24  [ = ]       0    .debug_frame
+0.0%    +648  [ = ]       0    .debug_info
+0.0%    +144  [ = ]       0    .debug_line
  [NEW]      +7  [ = ]       0    [Unmapped]
  +0.0%    +137  [ = ]       0    [section .debug_line]
+0.0%     +88  [ = ]       0    .debug_loclists
-0.0%     -24  [ = ]       0    .debug_rnglists
   +50%      +1  [ = ]       0    [Unmapped]
  -0.0%     -25  [ = ]       0    [section .debug_rnglists]
+0.0%    +312  [ = ]       0    .debug_str
+0.0%     +32  [ = ]       0    .symtab
  +7.7%     +32  [ = ]       0    hrt_elapsed_time
  +100%     +16  [ = ]       0    land_detector::FixedwingLandDetector::_set_hysteresis_factor()
 -25.0%     -16  [ = ]       0    land_detector::MulticopterLandDetector::_get_ground_contact_state()
-1.7%    -112  [ = ]       0    [Unmapped]
+0.0% +1.30Ki  +0.0%    +112    TOTAL

Updated: 2026-01-14T15:40:14

@mahima-yoga mahima-yoga requested a review from sfuhrer January 12, 2026 10:46
sfuhrer
sfuhrer previously approved these changes Jan 12, 2026
@mahima-yoga mahima-yoga marked this pull request as ready for review January 13, 2026 16:41
@mahima-yoga mahima-yoga force-pushed the pr-runway-takeoff-detection branch from 1ec6bee to bd6bd46 Compare January 13, 2026 16:50
@mahima-yoga
Copy link
Copy Markdown
Contributor Author

Thanks @sfuhrer! I added your suggestions, once approved I will clean up the commits

@mahima-yoga mahima-yoga requested a review from sfuhrer January 14, 2026 08:28
@mahima-yoga mahima-yoga force-pushed the pr-runway-takeoff-detection branch from bd6bd46 to 8a17d8c Compare January 14, 2026 15:33
@mahima-yoga mahima-yoga merged commit 95b8328 into main Jan 14, 2026
70 of 73 checks passed
@mahima-yoga mahima-yoga deleted the pr-runway-takeoff-detection branch January 14, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants