Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlphaFilter: set dt during update #24116

Merged
merged 4 commits into from
Dec 18, 2024
Merged

AlphaFilter: set dt during update #24116

merged 4 commits into from
Dec 18, 2024

Conversation

bresch
Copy link
Member

@bresch bresch commented Dec 16, 2024

Solved Problem

  1. We have some "Alpha" low-pass filters with the constant gain (i.e.: assuming a constant dt). If the dt changes or has jitter, the actual time constant/cutoff is different than expected.
  2. It is cumbersome to always call setParameters before an update function of the AlphaFilter class to update dt.

Solution

Store the filter time constant as a member variable
Allow passing dt as an argument of the update function
Allow setting the time constant in the constructor

Test coverage

unit tests

@bresch bresch requested review from dagar and MaEtUgR December 16, 2024 13:48
@bresch bresch self-assigned this Dec 16, 2024
Copy link

github-actions bot commented Dec 16, 2024

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 680 byte (0.03 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +680  +0.0%    +680    .text
  +0.3%    +552  +0.3%    +552    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.2%     +20  +0.2%     +20    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.2%     +16  +0.2%     +16    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.0%     +13  +0.0%     +13    [section .text]
  +0.4%     +12  +0.4%     +12    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.2%     +12  +0.2%     +12    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.1%     +12  +0.1%     +12    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  +0.2%      +8  +0.2%      +8    ../../src/lib/battery/battery.cpp
  +0.1%      +8  +0.1%      +8    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.5%      +8  +0.5%      +8    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.4%      +8  +0.4%      +8    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  +0.1%      +4  +0.1%      +4    ../../src/lib/tecs/TECS.cpp
  +0.3%      +4  +0.3%      +4    ../../src/modules/commander/HealthAndArmingChecks/checks/batteryCheck.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.8%      +4  +0.8%      +4    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.8%      +4  +0.8%      +4    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/manual_control/ManualControl.cpp
 -100.0%      -1 -100.0%      -1    [2 Others]
  -0.0%      -4  -0.0%      -4    ../../src/modules/commander/Commander.cpp
  -0.1%      -4  -0.1%      -4    ../../src/modules/ekf2/EKF/output_predictor/output_predictor.cpp
  -0.4%      -4  -0.4%      -4    ../../src/modules/sensors/vehicle_gps_position/VehicleGPSPosition.cpp
+0.0%     +56  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
-0.0%     -40  [ = ]       0    .debug_frame
+0.0% +5.36Ki  [ = ]       0    .debug_info
  +0.2%    +118  [ = ]       0    ../../src/lib/battery/battery.cpp
  +0.3%     +82  [ = ]       0    ../../src/lib/system_identification/system_identification.cpp
  +0.2%     +74  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.5%    +236  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
  +0.0%     +82  [ = ]       0    ../../src/modules/commander/Commander.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.7%     +82  [ = ]       0    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Descend/FlightTaskDescend.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAcceleration/FlightTaskManualAcceleration.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAccelerationSlow/FlightTaskManualAccelerationSlow.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualPosition/FlightTaskManualPosition.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  +0.2%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
 -99.8% +3.62Ki  [ = ]       0    [10 Others]
-0.0%    -149  [ = ]       0    .debug_line
  +0.6%     +47  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.0%      -2  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.2%     +10  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.0%      +3  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.1%      +1  [ = ]       0    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.0%      +1  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  -0.2%      -9  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  -0.6%     -17  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.1%     +12  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.2%     +17  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.2%     +42  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.2%     +33  [ = ]       0    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.0%      +2  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.2%     +53  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  -0.1%    -339  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.5%      +6  [ = ]       0    task/task_cancelpt.c
+0.0% +2.37Ki  [ = ]       0    .debug_loc
  +1.4%    +184  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.0%      -3  [ = ]       0    ../../src/lib/system_identification/system_identification.cpp
  -0.7%     -97  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  -0.0%     -15  [ = ]       0    ../../src/modules/commander/Commander.cpp
  -0.0%     -17  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  -0.0%     -13  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.cpp
  +0.0%     +13  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  -0.5%     -50  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  -0.3%     -14  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +2.3%    +105  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  -0.0%     -16  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.0%      +6  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  -0.1%     -64  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.2%     +86  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  -0.1%    -238  [ = ]       0    [section .debug_loc]
  +0.3% +2.50Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.1%     +15  [ = ]       0    src/modules/flight_mode_manager/FlightTasks_generated.cpp
+0.1% +1.74Ki  [ = ]       0    .debug_ranges
  +6.4%    +208  [ = ]       0    ../../src/lib/battery/battery.cpp
  +0.4%      +8  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +3.3%     +72  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.3%      +8  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  -0.1%      -8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  -0.7%      -8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +1.8%     +16  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.3%     +32  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.8%     +32  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.8%     +88  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.4%     +48  [ = ]       0    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.1%     +16  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.3%     +56  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  +0.0%      +8  [ = ]       0    [section .debug_ranges]
  +0.6% +1.19Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +3.1%      +2  [ = ]       0    task/task_cancelpt.c
+0.0%    +533  [ = ]       0    .debug_str
  +0.1%     +44  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
  +0.0%     +13  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.2%    +475  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.0%      +1  [ = ]       0    src/modules/flight_mode_manager/FlightTasks_generated.cpp
-0.5%      -1  [ = ]       0    .shstrtab
+0.0%      +1  [ = ]       0    .strtab
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  +0.4%      +1  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.0%     +32  [ = ]       0    [section .strtab]
-0.0%     -48  [ = ]       0    .symtab
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.1%     +48  [ = ]       0    [section .symtab]
  -0.3%     -48  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-3.8%    -680  [ = ]       0    [Unmapped]
+0.0% +9.81Ki  +0.0%    +680    TOTAL

px4_fmu-v6x [Total VM Diff: 680 byte (0.03 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.0%    +680  +0.0%    +680    .text
  +0.3%    +552  +0.3%    +552    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.2%     +20  +0.2%     +20    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.2%     +16  +0.2%     +16    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.0%     +13  +0.0%     +13    [section .text]
  +0.4%     +12  +0.4%     +12    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.2%     +12  +0.2%     +12    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.1%     +12  +0.1%     +12    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  +0.2%      +8  +0.2%      +8    ../../src/lib/battery/battery.cpp
  +0.1%      +8  +0.1%      +8    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.5%      +8  +0.5%      +8    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.4%      +8  +0.4%      +8    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  +0.1%      +4  +0.1%      +4    ../../src/lib/tecs/TECS.cpp
  +0.3%      +4  +0.3%      +4    ../../src/modules/commander/HealthAndArmingChecks/checks/batteryCheck.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.8%      +4  +0.8%      +4    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.8%      +4  +0.8%      +4    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +0.1%      +4  +0.1%      +4    ../../src/modules/manual_control/ManualControl.cpp
 -100.0%      -1 -100.0%      -1    [2 Others]
  -0.0%      -4  -0.0%      -4    ../../src/modules/commander/Commander.cpp
  -0.1%      -4  -0.1%      -4    ../../src/modules/ekf2/EKF/output_predictor/output_predictor.cpp
  -0.4%      -4  -0.4%      -4    ../../src/modules/sensors/vehicle_gps_position/VehicleGPSPosition.cpp
+0.0%     +56  [ = ]       0    .debug_abbrev
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
-0.0%      -8  [ = ]       0    .debug_aranges
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
-0.0%     -40  [ = ]       0    .debug_frame
+0.0% +5.36Ki  [ = ]       0    .debug_info
  +0.2%    +118  [ = ]       0    ../../src/lib/battery/battery.cpp
  +0.3%     +82  [ = ]       0    ../../src/lib/system_identification/system_identification.cpp
  +0.2%     +74  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -0.2%      -4  [ = ]       0    ../../src/lib/version/version.c
  +0.5%    +236  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
  +0.0%     +82  [ = ]       0    ../../src/modules/commander/Commander.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.7%     +82  [ = ]       0    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Descend/FlightTaskDescend.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAcceleration/FlightTaskManualAcceleration.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAccelerationSlow/FlightTaskManualAccelerationSlow.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitudeSmoothVel/FlightTaskManualAltitudeSmoothVel.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualPosition/FlightTaskManualPosition.cpp
  +0.1%     +87  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.1%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  +0.2%     +82  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
 -99.8% +3.62Ki  [ = ]       0    [10 Others]
-0.0%    -157  [ = ]       0    .debug_line
  +0.6%     +47  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.0%      -2  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  +0.2%     +10  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.0%      +3  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  +0.1%      +1  [ = ]       0    ../../src/modules/ekf2/EKF/bias_estimator/bias_estimator.cpp
  +0.0%      +1  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  -0.2%      -9  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  -0.6%     -17  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.1%     +12  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.2%     +17  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.2%     +42  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.2%     +33  [ = ]       0    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.0%      +2  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.2%     +53  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  -0.1%    -339  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  -0.2%      -2  [ = ]       0    task/task_cancelpt.c
+0.0% +2.22Ki  [ = ]       0    .debug_loc
  +1.4%    +184  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.0%      -3  [ = ]       0    ../../src/lib/system_identification/system_identification.cpp
  -0.7%     -97  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  -0.0%     -15  [ = ]       0    ../../src/modules/commander/Commander.cpp
  +0.1%     +11  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  -0.0%     -17  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  -0.0%     -13  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.cpp
  -0.6%     -65  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  -0.3%     -14  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +2.3%    +105  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  -0.1%     -63  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.0%      -4  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.0%      +6  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  -0.1%     -49  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.2%     +86  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  -0.1%    -200  [ = ]       0    [section .debug_loc]
  +0.3% +2.36Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.1%     +15  [ = ]       0    src/modules/flight_mode_manager/FlightTasks_generated.cpp
+0.1% +1.74Ki  [ = ]       0    .debug_ranges
  +6.4%    +208  [ = ]       0    ../../src/lib/battery/battery.cpp
  +0.4%      +8  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +3.3%     +72  [ = ]       0    ../../src/modules/airspeed_selector/AirspeedValidator.cpp
  +0.3%      +8  [ = ]       0    ../../src/modules/commander/failure_detector/FailureDetector.cpp
  -0.1%      -8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  -0.7%      -8  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickTiltXY.cpp
  +1.8%     +16  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.3%     +32  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.8%     +32  [ = ]       0    ../../src/modules/manual_control/ManualControl.cpp
  +0.8%     +88  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  +0.4%     +48  [ = ]       0    ../../src/modules/mc_autotune_attitude_control/mc_autotune_attitude_control.cpp
  +0.1%     +16  [ = ]       0    ../../src/modules/mc_pos_control/MulticopterPositionControl.cpp
  +0.3%     +56  [ = ]       0    ../../src/modules/sensors/vehicle_angular_velocity/VehicleAngularVelocity.cpp
  +0.0%      +8  [ = ]       0    [section .debug_ranges]
  +0.6% +1.19Ki  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +1.5%      +1  [ = ]       0    task/task_cancelpt.c
+0.0%    +533  [ = ]       0    .debug_str
  +0.1%     +44  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
  +0.0%     +13  [ = ]       0    ../../src/modules/fw_autotune_attitude_control/fw_autotune_attitude_control.cpp
  +0.2%    +475  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
  +0.0%      +1  [ = ]       0    src/modules/flight_mode_manager/FlightTasks_generated.cpp
-0.5%      -1  [ = ]       0    .shstrtab
+0.0%      +1  [ = ]       0    .strtab
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  +0.4%      +1  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickYaw.cpp
  +0.0%     +32  [ = ]       0    [section .strtab]
-0.0%     -48  [ = ]       0    .symtab
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +0.3%     +16  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  +0.1%     +48  [ = ]       0    [section .symtab]
  -0.3%     -48  [ = ]       0    src/modules/ekf2/modules__ekf2_unity.cpp
-0.9%    -680  [ = ]       0    [Unmapped]
+0.0% +9.65Ki  +0.0%    +680    TOTAL

Updated: 2024-12-18T09:40:32

Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Just a few comments to consider. I was thinking to make such a change before but had settled for the simplest possible interface which was neither the most convenient nor the most fitting for some client code.

Also why does this commit message start with temp?
grafik

src/modules/ekf2/EKF/ekf.h Outdated Show resolved Hide resolved
src/modules/ekf2/EKF/ekf.h Outdated Show resolved Hide resolved
src/modules/ekf2/EKF/ekf.h Outdated Show resolved Hide resolved
Then the update function can set the dt at every iteration if needed
The calculation of "alpha" in the accel_horiz and height_rate lowpass
filters is slightly different than before.
Copy link
Member

@MaEtUgR MaEtUgR left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all my nit-picks 👍

@MaEtUgR MaEtUgR merged commit 6b10f1c into main Dec 18, 2024
57 of 60 checks passed
@MaEtUgR MaEtUgR deleted the pr-alpha-dt branch December 18, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants