Skip to content

Conversation

@perrrre
Copy link
Contributor

@perrrre perrrre commented Oct 24, 2025

Solved Problem

Configured PX4 to enter controlled descent after (parameterized delay of) x s of dead reckoning.

Solution

  • Add parameter COM_DR_TOUT_T to specify time based threshold to safety action
  • Add parameter COM_DR_TOUT_ACT to select safety action after the timeout
  • Add failsafe flag dead_reckoning_invalid

Test coverage

  • Tested with fixed wing simulation with AMC 1.37.19
    At start up before gps is fixed, but vehicle is in landed, dead_reckoning_invalid is not updated
Screenshot from 2025-10-30 10-26-53

After simulating gps loss and setting COM_DR_TOUT_T to 3 s dead_reckoning_invalid is true
Screenshot from 2025-10-30 10-27-42

After landing and switching navigation state to stabilized warning appear again as flag isnt updated when vehicle is on ground
Screenshot from 2025-10-30 10-28-24

@perrrre perrrre requested a review from sfuhrer October 24, 2025 09:19
@github-actions
Copy link

github-actions bot commented Oct 24, 2025

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 840 byte (0.04 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +840  +0.0%    +840    .text
  [NEW]    +280  [NEW]    +280    EstimatorChecks::deadReckoningTimeout()
  +0.1%    +172  +0.1%    +172    g_cromfs_image
  +0.1%    +124  +0.1%    +124    [section .text]
   +15%     +72   +15%     +72    EstimatorChecks::EstimatorChecks()
  +2.9%     +44  +2.9%     +44    Failsafe::checkStateAndMode()
   +24%     +24   +24%     +24    EstimatorChecks::updateParamsImpl()
  +4.4%     +20  +4.4%     +20    Failsafe::Failsafe()
  +3.8%     +16  +3.8%     +16    EstimatorChecks::checkAndReport()
  +0.1%     +16  +0.1%     +16    px4::parameters
  +0.1%     +16  +0.1%     +16    uORB::compressed_fields
  +2.0%     +16  +2.0%     +16    ucdr_serialize_failsafe_flags()
  +5.3%     +12  +5.3%     +12    Failsafe::updateParamsImpl()
  +7.1%      +8  +7.1%      +8    EstimatorChecks::~EstimatorChecks()
 -97.6%      +8 -97.6%      +8    [4 Others]
  [NEW]      +4  [NEW]      +4    CSWTCH.848
  +2.6%      +4  +2.6%      +4    Commander::handleCommandsFromModeExecutors()
  +0.4%      +4  +0.4%      +4    Commander::run()
  +1.0%      +4  +1.0%      +4    EKFGSF_yaw::fuseVelocity()
  +4.8%      +4  +4.8%      +4    FlightTask
  [DEL]      -4  [DEL]      -4    CSWTCH.843
  -0.2%      -4  -0.2%      -4    HealthAndArmingChecks::HealthAndArmingChecks()
+0.0%     +56  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +56  [ = ]       0    .debug_frame
+0.0% +9.12Ki  [ = ]       0    .debug_info
+0.0%    +936  [ = ]       0    .debug_line
   +40%      +2  [ = ]       0    [Unmapped]
  +0.0%    +934  [ = ]       0    [section .debug_line]
+0.0%   +1008  [ = ]       0    .debug_loclists
+0.0%     +20  [ = ]       0    .debug_rnglists
  +200%      +2  [ = ]       0    [Unmapped]
  +0.0%     +18  [ = ]       0    [section .debug_rnglists]
+0.1% +2.07Ki  [ = ]       0    .debug_str
-0.8%      -2  [ = ]       0    .shstrtab
+0.0%     +90  [ = ]       0    .strtab
  [DEL]     -11  [ = ]       0    CSWTCH.843
  [NEW]     +11  [ = ]       0    CSWTCH.848
  [NEW]     +90  [ = ]       0    EstimatorChecks::deadReckoningTimeout()
 -39.0%     -16  [ = ]       0    __nxsched_get_tcb_veneer
   +76%     +16  [ = ]       0    __sq_addafter_veneer
+0.0%     +48  [ = ]       0    .symtab
  [DEL]     -32  [ = ]       0    CSWTCH.843
  [NEW]     +32  [ = ]       0    CSWTCH.848
  +100%     +16  [ = ]       0    Commander::checkWorkerThread()
 -33.3%     -16  [ = ]       0    Commander::updateTunes()
 -50.0%     -32  [ = ]       0    EKFGSF_yaw::fuseVelocity()
  [NEW]     +48  [ = ]       0    EstimatorChecks::deadReckoningTimeout()
 -25.0%     -16  [ = ]       0    Failsafe::checkStateAndMode()
 -16.7%     -16  [ = ]       0    Failsafe::fromOffboardLossActParam()
  +0.6%     +64  [ = ]       0    [section .symtab]
 -40.0%     -32  [ = ]       0    __nxsched_get_tcb_veneer
   +67%     +32  [ = ]       0    __sq_addafter_veneer
   +33%     +16  [ = ]       0    __stm32_ep0out_setup_veneer
 -25.0%     -16  [ = ]       0    __stm32_i2c_set_bytes_to_transfer_veneer
   +25%     +16  [ = ]       0    matrix::Matrix<>::operator+=()
 -25.0%     -16  [ = ]       0    matrix::Matrix<>::operator/()
-7.5%    -840  [ = ]       0    [Unmapped]
+0.0% +13.4Ki  +0.0%    +840    TOTAL

px4_fmu-v6x [Total VM Diff: 728 byte (0.04 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +728  +0.0%    +728    .text
  [NEW]    +280  [NEW]    +280    EstimatorChecks::deadReckoningTimeout()
  +0.1%    +148  +0.1%    +148    g_cromfs_image
  +0.1%    +128  +0.1%    +128    [section .text]
   +15%     +72   +15%     +72    EstimatorChecks::EstimatorChecks()
  +2.9%     +44  +2.9%     +44    Failsafe::checkStateAndMode()
   +24%     +24   +24%     +24    EstimatorChecks::updateParamsImpl()
  +4.4%     +20  +4.4%     +20    Failsafe::Failsafe()
  +3.8%     +16  +3.8%     +16    EstimatorChecks::checkAndReport()
  +0.1%     +16  +0.1%     +16    px4::parameters
  +0.1%     +16  +0.1%     +16    uORB::compressed_fields
  +2.0%     +16  +2.0%     +16    ucdr_serialize_failsafe_flags()
  +5.3%     +12  +5.3%     +12    Failsafe::updateParamsImpl()
  +7.1%      +8  +7.1%      +8    EstimatorChecks::~EstimatorChecks()
  [NEW]      +4  [NEW]      +4    CSWTCH.848
  +0.4%      +4  +0.4%      +4    Commander::run()
  [DEL]      -4  [DEL]      -4    CSWTCH.843
  -2.5%      -4  -2.5%      -4    Commander::handleCommandsFromModeExecutors()
 -25.0%      -4 -25.0%      -4    ConstLayer::contains()
 -14.3%      -4 -14.3%      -4    ConstLayer::get()
  -1.0%      -4  -1.0%      -4    EKFGSF_yaw::fuseVelocity()
 -100.8%     -60 -100.8%     -60    [23 Others]
+0.0%     +56  [ = ]       0    .debug_abbrev
+0.0%      +8  [ = ]       0    .debug_aranges
+0.0%     +56  [ = ]       0    .debug_frame
+0.0% +8.99Ki  [ = ]       0    .debug_info
+0.0%    +902  [ = ]       0    .debug_line
  +400%      +4  [ = ]       0    [Unmapped]
  +0.0%    +898  [ = ]       0    [section .debug_line]
+0.0% +1.11Ki  [ = ]       0    .debug_loclists
+0.0%     +15  [ = ]       0    .debug_rnglists
   +50%      +1  [ = ]       0    [Unmapped]
  +0.0%     +14  [ = ]       0    [section .debug_rnglists]
+0.1% +2.07Ki  [ = ]       0    .debug_str
+0.9%      +2  [ = ]       0    .shstrtab
+0.0%     +90  [ = ]       0    .strtab
  [DEL]     -11  [ = ]       0    CSWTCH.843
  [NEW]     +11  [ = ]       0    CSWTCH.848
  [NEW]     +90  [ = ]       0    EstimatorChecks::deadReckoningTimeout()
+0.0%     +48  [ = ]       0    .symtab
  [DEL]     -32  [ = ]       0    CSWTCH.843
  [NEW]     +32  [ = ]       0    CSWTCH.848
  +100%     +16  [ = ]       0    Commander::checkWorkerThread()
 -33.3%     -16  [ = ]       0    Commander::updateTunes()
  +100%     +16  [ = ]       0    ConstLayer::contains()
 -33.3%     -16  [ = ]       0    ConstLayer::store()
   +25%     +16  [ = ]       0    DynamicSparseLayer::DynamicSparseLayer()
  +100%     +32  [ = ]       0    EKFGSF_yaw::fuseVelocity()
  [NEW]     +48  [ = ]       0    EstimatorChecks::deadReckoningTimeout()
 -25.0%     -16  [ = ]       0    Failsafe::checkStateAndMode()
 -16.7%     -16  [ = ]       0    Failsafe::fromOffboardLossActParam()
  -0.4%     -48  [ = ]       0    [section .symtab]
   +25%     +16  [ = ]       0    matrix::Matrix<>::operator+=()
 -25.0%     -16  [ = ]       0    matrix::Matrix<>::operator/()
  +100%     +16  [ = ]       0    param_for_index
  +100%     +16  [ = ]       0    param_get_index
-10.6%    -728  [ = ]       0    [Unmapped]
+0.0% +13.3Ki  +0.0%    +728    TOTAL

Updated: 2025-10-30T08:42:23

@perrrre perrrre force-pushed the feature/add-dead-reckoning branch from 7db07a4 to b32f3f6 Compare October 24, 2025 11:59
@perrrre perrrre force-pushed the feature/add-dead-reckoning branch from 2ad8813 to a7118bd Compare October 24, 2025 14:56
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.

4 participants