mag_bias_estimator: sensor update loop limit iterations

This commit is contained in:
Daniel Agar 2024-03-04 12:57:58 -05:00
parent d96970a2b9
commit 87960c04d8
1 changed files with 3 additions and 2 deletions

View File

@ -157,10 +157,11 @@ void MagBiasEstimator::Run()
bool updated = false;
for (int mag_index = 0; mag_index < MAX_SENSOR_COUNT; mag_index++) {
int sensor_mag_updates = 0;
sensor_mag_s sensor_mag;
while (_sensor_mag_subs[mag_index].update(&sensor_mag)) {
while ((sensor_mag_updates < sensor_mag_s::ORB_QUEUE_LENGTH) && _sensor_mag_subs[mag_index].update(&sensor_mag)) {
sensor_mag_updates++;
updated = true;
// apply existing mag calibration