1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-30 08:24:11 +01:00

OP-1384 gyro calibration will not zero revo board rotation anymore

This commit is contained in:
Philippe Renon 2014-07-03 00:22:40 +02:00
parent 0e1fd756ab
commit 4de8575fa9
3 changed files with 9 additions and 13 deletions

View File

@ -55,18 +55,23 @@ GyroBiasCalibrationModel::GyroBiasCalibrationModel(QObject *parent) :
void GyroBiasCalibrationModel::start()
{
// Store and reset board rotation before calibration starts
storeAndClearBoardRotation();
// reset dirty state to forget previous unsaved runs
m_dirty = false;
// configure board for calibration
RevoCalibration::DataFields revoCalibrationData = revoCalibration->getData();
memento.revoCalibrationData = revoCalibrationData;
revoCalibrationData.BiasCorrectedRaw = RevoCalibration::BIASCORRECTEDRAW_FALSE;
revoCalibration->setData(revoCalibrationData);
// Disable gyro bias correction while calibrating
AttitudeSettings::DataFields attitudeSettingsData = attitudeSettings->getData();
memento.attitudeSettingsData = attitudeSettingsData;
// Disable gyro bias correction while calibrating
attitudeSettingsData.BiasCorrectGyro = AttitudeSettings::BIASCORRECTGYRO_FALSE;
// Zero board rotation
attitudeSettingsData.BoardRotation[AttitudeSettings::BOARDROTATION_YAW] = 0;
attitudeSettingsData.BoardRotation[AttitudeSettings::BOARDROTATION_ROLL] = 0;
attitudeSettingsData.BoardRotation[AttitudeSettings::BOARDROTATION_PITCH] = 0;
attitudeSettings->setData(attitudeSettingsData);
UAVObject::Metadata gyroStateMetadata = gyroState->getMetadata();
@ -89,9 +94,6 @@ void GyroBiasCalibrationModel::start()
gyro_state_accum_y.clear();
gyro_state_accum_z.clear();
// reset dirty state to forget previous unsaved runs
m_dirty = false;
started();
progressChanged(0);
displayVisualHelp(CALIBRATION_HELPER_PLANE_PREFIX + CALIBRATION_HELPER_IMAGE_NED);
@ -149,9 +151,6 @@ void GyroBiasCalibrationModel::getSample(UAVObject *obj)
revoCalibration->setData(memento.revoCalibrationData);
attitudeSettings->setData(memento.attitudeSettingsData);
// Recall saved board rotation
recallBoardRotation();
stopped();
displayInstructions(tr("Gyroscope calibration completed successfully."), WizardModel::Success);
displayVisualHelp(CALIBRATION_HELPER_IMAGE_EMPTY);

View File

@ -57,8 +57,7 @@ public:
signals:
void started();
void stopped();
void storeAndClearBoardRotation();
void recallBoardRotation();
void progressChanged(int value);
void displayVisualHelp(QString elementID);
void displayInstructions(QString text, WizardModel::MessageType type = WizardModel::Info);

View File

@ -157,8 +157,6 @@ ConfigRevoWidget::ConfigRevoWidget(QWidget *parent) :
connect(m_gyroBiasCalibrationModel, SIGNAL(started()), this, SLOT(disableAllCalibrations()));
connect(m_gyroBiasCalibrationModel, SIGNAL(stopped()), this, SLOT(enableAllCalibrations()));
connect(m_gyroBiasCalibrationModel, SIGNAL(storeAndClearBoardRotation()), this, SLOT(storeAndClearBoardRotation()));
connect(m_gyroBiasCalibrationModel, SIGNAL(recallBoardRotation()), this, SLOT(recallBoardRotation()));
connect(m_gyroBiasCalibrationModel, SIGNAL(displayInstructions(QString, WizardModel::MessageType)),
this, SLOT(addInstructions(QString, WizardModel::MessageType)));
connect(m_gyroBiasCalibrationModel, SIGNAL(displayVisualHelp(QString)), this, SLOT(displayVisualHelp(QString)));