diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-10-21 23:33:01 +0200 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-10-21 23:33:01 +0200 |
commit | 495073935e428d99833135bb227f3085d2def1cf (patch) | |
tree | 69acf61240a66049d271fb368715e12e1a2e5213 /src/modules/commander/accelerometer_calibration.cpp | |
parent | ef42ef15c6991800111b25374b0f6e3935c2a9a9 (diff) | |
download | px4-firmware-495073935e428d99833135bb227f3085d2def1cf.tar.gz px4-firmware-495073935e428d99833135bb227f3085d2def1cf.tar.bz2 px4-firmware-495073935e428d99833135bb227f3085d2def1cf.zip |
accelerometer_calibration: stability fix
Diffstat (limited to 'src/modules/commander/accelerometer_calibration.cpp')
-rw-r--r-- | src/modules/commander/accelerometer_calibration.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/commander/accelerometer_calibration.cpp b/src/modules/commander/accelerometer_calibration.cpp index 49a8d6b33..5eeca5a1a 100644 --- a/src/modules/commander/accelerometer_calibration.cpp +++ b/src/modules/commander/accelerometer_calibration.cpp @@ -180,10 +180,13 @@ int do_accel_calibration(int mavlink_fd) mavlink_log_critical(mavlink_fd, CAL_FAILED_RESET_CAL_MSG); } - /* measure and calculate offsets & scales */ float accel_offs[3]; float accel_T[3][3]; - res = do_accel_calibration_measurements(mavlink_fd, accel_offs, accel_T); + + if (res == OK) { + /* measure and calculate offsets & scales */ + res = do_accel_calibration_measurements(mavlink_fd, accel_offs, accel_T); + } if (res == OK) { /* measurements completed successfully, rotate calibration values */ |