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

OP-1150 UI for thermal calibration: fill calibration extent fields for accel/gyro

This commit is contained in:
Alessio Morale 2014-01-31 21:01:59 +01:00
parent 68d676db64
commit fb8bba4bec
2 changed files with 11 additions and 1 deletions

View File

@ -76,6 +76,10 @@ bool ThermalCalibrationHelper::setupBoardForCalibration()
for (int i = 0; i < AccelGyroSettings::GYRO_TEMP_COEFF_NUMELEM; i++) { for (int i = 0; i < AccelGyroSettings::GYRO_TEMP_COEFF_NUMELEM; i++) {
data.gyro_temp_coeff[i] = 0.0f; data.gyro_temp_coeff[i] = 0.0f;
} }
data.temp_calibrated_extent[0] = 0.0f;
data.temp_calibrated_extent[1] = 0.0f;
accelGyroSettings->setData(data); accelGyroSettings->setData(data);
// clean any correction before calibrating // clean any correction before calibrating
@ -316,7 +320,8 @@ void ThermalCalibrationHelper::calculate()
} }
m_results.gyroCalibrated = ThermalCalibration::GyroscopeCalibration(datax, datay, dataz, datat, m_results.gyro, m_results.gyroInSigma, m_results.gyroOutSigma); m_results.gyroCalibrated = ThermalCalibration::GyroscopeCalibration(datax, datay, dataz, datat, m_results.gyro, m_results.gyroInSigma, m_results.gyroOutSigma);
m_results.accelGyroTempMin = datat.array().minCoeff();
m_results.accelGyroTempMax = datat.array().maxCoeff();
// TODO: sanity checks needs to be enforced before accel calibration can be enabled and usable. // TODO: sanity checks needs to be enforced before accel calibration can be enabled and usable.
/* /*
setProcessPercentage(processPercentage() + 2); setProcessPercentage(processPercentage() + 2);
@ -472,6 +477,9 @@ void ThermalCalibrationHelper::copyResultToSettings()
data.accel_temp_coeff[1] = m_results.gyro[1]; data.accel_temp_coeff[1] = m_results.gyro[1];
data.accel_temp_coeff[2] = m_results.gyro[2]; data.accel_temp_coeff[2] = m_results.gyro[2];
} }
data.temp_calibrated_extent[0] = m_results.accelGyroTempMin;
data.temp_calibrated_extent[1] = m_results.accelGyroTempMax;
accelGyroSettings->setData(data); accelGyroSettings->setData(data);
accelGyroSettings->updated(); accelGyroSettings->updated();
} }

View File

@ -79,6 +79,8 @@ typedef struct {
float gyroOutSigma[3]; float gyroOutSigma[3];
float baroTempMin; float baroTempMin;
float baroTempMax; float baroTempMax;
float accelGyroTempMin;
float accelGyroTempMax;
} thermalCalibrationResults; } thermalCalibrationResults;
class ThermalCalibrationHelper : public QObject { class ThermalCalibrationHelper : public QObject {
Q_OBJECT Q_OBJECT