From 64cacc2c6931de9d3d2629c8a24e573406260a63 Mon Sep 17 00:00:00 2001 From: sambas Date: Mon, 28 Mar 2011 15:29:21 +0000 Subject: [PATCH] Better init values for gyro_scale, I had problems getting gyros calibrated. git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3087 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../openpilotgcs/src/plugins/config/configahrswidget.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp index 55d7b2154..9e8116f0d 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp @@ -887,6 +887,7 @@ void ConfigAHRSWidget::sixPointCalibrationMode() // set accels to unity gain UAVObjectField *field = obj->getField(QString("accel_scale")); + UAVObjectField *field2 = obj->getField(QString("gyro_scale")); // TODO: Figure out how to load these directly from the saved metadata // about default values field->setDouble(0.0359, 0); @@ -904,9 +905,9 @@ void ConfigAHRSWidget::sixPointCalibrationMode() } field = obj->getField(QString("gyro_bias")); - field->setDouble(23,0); - field->setDouble(-23,1); - field->setDouble(23,2); + field->setDouble(28/0.017*field2->getDouble(0),0); + field->setDouble(-28/0.017*field2->getDouble(1),1); + field->setDouble(28/0.017*field2->getDouble(2),2); field = obj->getField(QString("mag_scale")); for (int i = 0; i < 3; ++i) {