From e1ff6af7926f4eb07481188912c952fa0303f30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 17 Jan 2017 18:55:17 +0100 Subject: [PATCH] mc_att_control_main: initialize _sensor_corrections properly --- src/modules/mc_att_control/mc_att_control_main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/mc_att_control/mc_att_control_main.cpp b/src/modules/mc_att_control/mc_att_control_main.cpp index c23f48cd64..1f4a752007 100644 --- a/src/modules/mc_att_control/mc_att_control_main.cpp +++ b/src/modules/mc_att_control/mc_att_control_main.cpp @@ -536,6 +536,14 @@ MulticopterAttitudeControl::MulticopterAttitudeControl() : _ts_opt_recovery = new TailsitterRecovery(); } + /* initialize _corrections to identity as we might not immediately get a topic update */ + for (unsigned i = 0; i < 3; i++) { + _sensor_correction.gyro_scale[i] = 1.0f; + _sensor_correction.accel_scale[i] = 1.0f; + } + + _sensor_correction.baro_scale = 1.0f; + }