Skip to content

[WIP] ekf2: EKF init immediately on first IMU sample#24046

Closed
dagar wants to merge 1 commit intomainfrom
pr-ekf2_imu_init
Closed

[WIP] ekf2: EKF init immediately on first IMU sample#24046
dagar wants to merge 1 commit intomainfrom
pr-ekf2_imu_init

Conversation

@dagar
Copy link
Member

@dagar dagar commented Nov 27, 2024

  • tilt init use filtered accel/gyro on delayed time horizon
  • publish estimator_status on every EKF update (even if !_filter_initialised)
  • completely de-virtualize Ekf

 - tilt init use filtered accel/gyro on delayed time horizon
 - publish estimator_status on every EKF update (even if !_filter_initialised)
@dagar dagar added the EKF2 label Nov 27, 2024
@github-actions
Copy link

github-actions bot commented Nov 27, 2024

FLASH Analysis

px4_fmu-v5x
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0% +6.32Ki  [ = ]       0    .debug_info
  +0.7% +6.32Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.1% +5.27Ki  [ = ]       0    .debug_loc
  +5.8% +21.0Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  -1.0% -15.7Ki  [ = ]       0    [section .debug_loc]
+0.2% +2.23Ki  [ = ]       0    .debug_ranges
  +5.2% +5.91Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  -1.5% -3.68Ki  [ = ]       0    [section .debug_ranges]
+0.0% +2.11Ki  [ = ]       0    .debug_line
  +0.6% +2.11Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.4%     +86  [ = ]       0    [Unmapped]
+0.0%     +46  [ = ]       0    .debug_abbrev
  +0.0%     +46  [ = ]       0    armv7-m/arm_vectors.c
-0.0%     -80  -0.0%     -80    .text
  -0.0%     -24  -0.0%     -24    [section .text]
  -0.0%     -56  -0.0%     -56    src/modules/ekf2/modules__ekf2_unity.cpp
-0.1%    -104  [ = ]       0    .debug_aranges
-0.0%    -148  [ = ]       0    .strtab
  -0.0%     -34  [ = ]       0    [section .strtab]
  -0.7%    -114  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.0%    -156  [ = ]       0    .debug_str
  -0.0%      -9  [ = ]       0    [section .debug_str]
  -0.0%    -147  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.0%    -304  [ = ]       0    .symtab
  -0.1%     -64  [ = ]       0    [section .symtab]
  -1.7%    -240  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.1%    -368  [ = ]       0    .debug_frame
+0.0% +14.9Ki  -0.0%     -80    TOTAL

px4_fmu-v6x
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0% +6.32Ki  [ = ]       0    .debug_info
  +0.7% +6.32Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.1% +5.38Ki  [ = ]       0    .debug_loc
  +5.8% +21.0Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  -1.0% -15.6Ki  [ = ]       0    [section .debug_loc]
+0.2% +2.23Ki  [ = ]       0    .debug_ranges
  +5.2% +5.91Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  -1.5% -3.68Ki  [ = ]       0    [section .debug_ranges]
+0.0% +2.11Ki  [ = ]       0    .debug_line
  +0.6% +2.11Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
+0.1%     +85  [ = ]       0    [Unmapped]
+0.0%     +46  [ = ]       0    .debug_abbrev
  +0.0%     +46  [ = ]       0    armv7-m/arm_vectors.c
-0.0%     -80  -0.0%     -80    .text
  -0.0%     -24  -0.0%     -24    [section .text]
  -0.0%     -56  -0.0%     -56    src/modules/ekf2/modules__ekf2_unity.cpp
-0.1%    -104  [ = ]       0    .debug_aranges
-0.0%    -148  [ = ]       0    .strtab
  -0.0%     -34  [ = ]       0    [section .strtab]
  -0.7%    -114  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.0%    -156  [ = ]       0    .debug_str
  -0.0%      -9  [ = ]       0    [section .debug_str]
  -0.0%    -147  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.0%    -304  [ = ]       0    .symtab
  -0.1%     -64  [ = ]       0    [section .symtab]
  -1.7%    -240  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.1%    -368  [ = ]       0    .debug_frame
+0.0% +15.0Ki  -0.0%     -80    TOTAL

Updated: 2024-11-27T22:44:49

Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

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

It's a nice cleanup, we shouldn't forget about this PR


} else {
// if filter not initialized

Copy link
Member

Choose a reason for hiding this comment

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

is this the only missing piece of this PR?

_is_first_imu_sample = false;

_state = {};
initialiseTilt(_accel_lpf.getState());
Copy link
Member

Choose a reason for hiding this comment

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

Is this to get a tilt estimate even if accel norm is > 20% longer or smaller than 1g?

}
}

updateIMUBiasInhibit(imu_sample_delayed);
Copy link
Member

Choose a reason for hiding this comment

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

Why running the state and covariance prediction if the filter is not initialized?

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

This pull request has been automatically closed due to 120 days of inactivity. If you would like to continue, please feel free to reopen it or submit a new PR.

@github-actions github-actions bot closed this Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants