From 5a96490c689d36d319248468799644cc53b9c22a Mon Sep 17 00:00:00 2001 From: Mohammed Kabir Date: Tue, 13 Jun 2017 07:52:30 +0530 Subject: [PATCH] sensors : fix race condition triggered by slow-to-boot external sensors --- src/modules/sensors/voted_sensors_update.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/sensors/voted_sensors_update.cpp b/src/modules/sensors/voted_sensors_update.cpp index 742a33e0e2..9a33a106ba 100644 --- a/src/modules/sensors/voted_sensors_update.cpp +++ b/src/modules/sensors/voted_sensors_update.cpp @@ -740,6 +740,11 @@ void VotedSensorsUpdate::mag_poll(struct sensor_combined_s &raw) // First publication with data if (_mag.priority[uorb_index] == 0) { + + // Parameters update to get offsets and scaling loaded (if not already loaded) + parameters_update(); + + // Set device priority for the voter int32_t priority = 0; orb_priority(_mag.subscription[uorb_index], &priority); _mag.priority[uorb_index] = (uint8_t)priority;