From 7789e2de88533986d73db01774f6ca0e9b25a12b Mon Sep 17 00:00:00 2001 From: Burak Saruhan Date: Wed, 31 Jul 2019 22:22:59 +0300 Subject: [PATCH] sensors: mag reload calibration parameters when first seen (#12586) * fixes UAVCAN MAG calibration application after reboot --- src/modules/sensors/voted_sensors_update.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/sensors/voted_sensors_update.cpp b/src/modules/sensors/voted_sensors_update.cpp index 4ddc4a3ed2..dd874fe9e3 100644 --- a/src/modules/sensors/voted_sensors_update.cpp +++ b/src/modules/sensors/voted_sensors_update.cpp @@ -764,6 +764,9 @@ void VotedSensorsUpdate::mag_poll(vehicle_magnetometer_s &magnetometer) int32_t priority = 0; orb_priority(_mag.subscription[uorb_index], &priority); _mag.priority[uorb_index] = (uint8_t)priority; + + /* force a scale and offset update the first time we get data */ + parameters_update(); } matrix::Vector3f vect(mag_report.x, mag_report.y, mag_report.z);