mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 07:03:34 +08:00
ekf2: move parameter update to beginning of cycle
This commit is contained in:
+10
-11
@@ -251,6 +251,16 @@ void EKF2::Run()
|
||||
}
|
||||
}
|
||||
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
// update parameters from storage
|
||||
updateParams();
|
||||
}
|
||||
|
||||
bool updated = false;
|
||||
imuSample imu_sample_new {};
|
||||
|
||||
@@ -297,17 +307,6 @@ void EKF2::Run()
|
||||
}
|
||||
|
||||
if (updated) {
|
||||
|
||||
// check for parameter updates
|
||||
if (_parameter_update_sub.updated()) {
|
||||
// clear update
|
||||
parameter_update_s pupdate;
|
||||
_parameter_update_sub.copy(&pupdate);
|
||||
|
||||
// update parameters from storage
|
||||
updateParams();
|
||||
}
|
||||
|
||||
const hrt_abstime now = imu_sample_new.time_us;
|
||||
|
||||
// ekf2_timestamps (using 0.1 ms relative timestamps)
|
||||
|
||||
Reference in New Issue
Block a user