1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Ground/AHRS Config: Made gyro bias computation happen on GCS during 6pt

calibration

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1781 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2010-09-27 07:48:28 +00:00 committed by peabody124
parent 22db0d8785
commit c5863320fe

View File

@ -404,9 +404,6 @@ void ConfigAHRSWidget::savePositionData()
mag_accum_x.clear(); mag_accum_x.clear();
mag_accum_y.clear(); mag_accum_y.clear();
mag_accum_z.clear(); mag_accum_z.clear();
gyro_accum_x.clear();
gyro_accum_y.clear();
gyro_accum_z.clear();
collectingData = true; collectingData = true;
UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AttitudeRaw"))); UAVObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AttitudeRaw")));
@ -526,10 +523,16 @@ void ConfigAHRSWidget::computeScaleBias()
SixPointInConstFieldCal( 9.81, accel_data_x, accel_data_y, accel_data_z, S, b); SixPointInConstFieldCal( 9.81, accel_data_x, accel_data_y, accel_data_z, S, b);
field = obj->getField(QString("gyro_bias"));
field->setDouble(listMean(gyro_accum_x),0);
field->setDouble(listMean(gyro_accum_y),1);
field->setDouble(listMean(gyro_accum_z),2);
field = obj->getField(QString("accel_scale")); field = obj->getField(QString("accel_scale"));
field->setDouble(S[0],0); field->setDouble(S[0],0);
field->setDouble(S[1],1); field->setDouble(S[1],1);
field->setDouble(S[2],2); field->setDouble(S[2],2);
field = obj->getField(QString("accel_bias")); field = obj->getField(QString("accel_bias"));
field->setDouble(b[0],0); field->setDouble(b[0],0);
field->setDouble(b[1],1); field->setDouble(b[1],1);
@ -540,15 +543,16 @@ void ConfigAHRSWidget::computeScaleBias()
field->setDouble(S[0],0); field->setDouble(S[0],0);
field->setDouble(S[1],1); field->setDouble(S[1],1);
field->setDouble(S[2],2); field->setDouble(S[2],2);
field = obj->getField(QString("mag_bias")); field = obj->getField(QString("mag_bias"));
field->setDouble(b[0], 0); field->setDouble(b[0], 0);
field->setDouble(b[1], 1); field->setDouble(b[1], 1);
field->setDouble(b[2], 2); field->setDouble(b[2], 2);
field = obj->getField(QString("gyro_bias")); field = obj->getField(QString("gyro_bias"));
field->setDouble(listMean(gyro_accum_x),0); field->setDouble(-listMean(gyro_accum_x),0);
field->setDouble(listMean(gyro_accum_y),1); field->setDouble(-listMean(gyro_accum_y),1);
field->setDouble(listMean(gyro_accum_z),2); field->setDouble(-listMean(gyro_accum_z),2);
obj->updated(); obj->updated();
@ -569,12 +573,22 @@ void ConfigAHRSWidget::sixPointCalibrationMode()
field->setDouble(1,0); field->setDouble(1,0);
field->setDouble(1,1); field->setDouble(1,1);
field->setDouble(1,2); field->setDouble(1,2);
field = obj->getField(QString("accel_bias")); field = obj->getField(QString("accel_bias"));
field->setDouble(0,0); field->setDouble(0,0);
field->setDouble(0,1); field->setDouble(0,1);
field->setDouble(0,2); field->setDouble(0,2);
field = obj->getField(QString("gyro_bias"));
field->setDouble(0,0);
field->setDouble(0,1);
field->setDouble(0,2);
obj->updated(); obj->updated();
gyro_accum_x.clear();
gyro_accum_y.clear();
gyro_accum_z.clear();
/* Make sure we get AttitudeRaw updates, and skip AttitudeActual (for speed) */ /* Make sure we get AttitudeRaw updates, and skip AttitudeActual (for speed) */
obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings"))); obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("AHRSSettings")));
field = obj->getField(QString("UpdateRaw")); field = obj->getField(QString("UpdateRaw"));