2 ******************************************************************************
4 * @file biascalibrationutil.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
8 * @addtogroup BiasCalibrationUtil
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef BIASCALIBRATIONUTIL_H
29 #define BIASCALIBRATIONUTIL_H
34 #include "uavobject.h"
35 #include "vehicleconfigurationsource.h"
37 class BiasCalibrationUtil
: public QObject
{
40 explicit BiasCalibrationUtil(long measurementCount
, long measurementRate
);
41 explicit BiasCalibrationUtil(long accelMeasurementCount
, long accelMeasurementRate
,
42 long gyroMeasurementCount
, long gyroMeasurementRate
);
45 void progress(long current
, long total
);
46 void done(accelGyroBias measuredBias
);
47 void timeout(QString message
);
54 void gyroMeasurementsUpdated(UAVObject
*obj
);
55 void accelMeasurementsUpdated(UAVObject
*obj
);
59 QTimer m_timeoutTimer
;
62 long m_receivedAccelUpdates
;
63 long m_receivedGyroUpdates
;
65 long m_accelMeasurementCount
;
66 long m_gyroMeasurementCount
;
67 long m_accelMeasurementRate
;
68 long m_gyroMeasurementRate
;
70 UAVObject::Metadata m_previousGyroMetaData
;
71 UAVObject::Metadata m_previousAccelMetaData
;
73 double m_accelerometerX
;
74 double m_accelerometerY
;
75 double m_accelerometerZ
;
81 void startMeasurement();
82 void stopMeasurement();
85 #endif // BIASCALIBRATIONUTIL_H