mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Ground/AHRSCalibration: Account for conversion in AHRS
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1918 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
a081fb7ec1
commit
9ec694cc40
@ -515,10 +515,10 @@ 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 = obj->getField(QString("gyro_bias"));
|
||||||
field->setDouble(listMean(gyro_accum_x),0);
|
field->setDouble(-listMean(gyro_accum_x) * M_PI / 180.0f,0);
|
||||||
field->setDouble(listMean(gyro_accum_y),1);
|
field->setDouble(-listMean(gyro_accum_y) * M_PI / 180.0f,1);
|
||||||
field->setDouble(listMean(gyro_accum_z),2);
|
field->setDouble(-listMean(gyro_accum_z) * M_PI / 180.0f,2);
|
||||||
|
qDebug() << listMean(gyro_accum_x) * M_PI / 180.0f << listMean(gyro_accum_y) * M_PI / 180.0f << listMean(gyro_accum_x) * M_PI / 180.0f;
|
||||||
field = obj->getField(QString("accel_scale"));
|
field = obj->getField(QString("accel_scale"));
|
||||||
field->setDouble(sign(S[0]) * S[0],0);
|
field->setDouble(sign(S[0]) * S[0],0);
|
||||||
field->setDouble(sign(S[1]) * S[1],1);
|
field->setDouble(sign(S[1]) * S[1],1);
|
||||||
@ -540,23 +540,6 @@ void ConfigAHRSWidget::computeScaleBias()
|
|||||||
field->setDouble(sign(S[1]) * b[1], 1);
|
field->setDouble(sign(S[1]) * b[1], 1);
|
||||||
field->setDouble(sign(S[2]) * b[2], 2);
|
field->setDouble(sign(S[2]) * b[2], 2);
|
||||||
|
|
||||||
// Go ahead and fix gyro scale here
|
|
||||||
field = obj->getField(QString("gyro_bias"));
|
|
||||||
double a = field->getDouble(0);
|
|
||||||
field->setDouble(-sign(a) * a, 0);
|
|
||||||
a = field->getDouble(1);
|
|
||||||
field->setDouble(sign(a) * a, 1);
|
|
||||||
a = field->getDouble(2);
|
|
||||||
field->setDouble(-sign(a) * a, 2);
|
|
||||||
|
|
||||||
field = obj->getField(QString("gyro_bias"));
|
|
||||||
a = listMean(gyro_accum_x);
|
|
||||||
field->setDouble(sign(a)*a,0);
|
|
||||||
a = listMean(gyro_accum_y);
|
|
||||||
field->setDouble(-sign(a)*a,1);
|
|
||||||
a = listMean(gyro_accum_z);
|
|
||||||
field->setDouble(sign(a)*a,2);
|
|
||||||
|
|
||||||
obj->updated();
|
obj->updated();
|
||||||
|
|
||||||
position = -1; //set to run again
|
position = -1; //set to run again
|
||||||
|
Loading…
Reference in New Issue
Block a user