LP-106 Setup Wizard refresh : Add dual servo setup (dual aileron or
[librepilot.git] / ground / gcs / src / plugins / setupwizard / biascalibrationutil.h
blobc5e0af4ed11f284bad3c8e299a214e43552fe501
1 /**
2 ******************************************************************************
4 * @file biascalibrationutil.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
6 * @addtogroup
7 * @{
8 * @addtogroup BiasCalibrationUtil
9 * @{
10 * @brief
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
21 * for more details.
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
31 #include <QObject>
32 #include <QTimer>
34 #include "uavobject.h"
35 #include "vehicleconfigurationsource.h"
37 class BiasCalibrationUtil : public QObject {
38 Q_OBJECT
39 public:
40 explicit BiasCalibrationUtil(long measurementCount, long measurementRate);
41 explicit BiasCalibrationUtil(long accelMeasurementCount, long accelMeasurementRate,
42 long gyroMeasurementCount, long gyroMeasurementRate);
44 signals:
45 void progress(long current, long total);
46 void done(accelGyroBias measuredBias);
47 void timeout(QString message);
49 public slots:
50 void start();
51 void abort();
53 private slots:
54 void gyroMeasurementsUpdated(UAVObject *obj);
55 void accelMeasurementsUpdated(UAVObject *obj);
56 void timeout();
58 private:
59 QTimer m_timeoutTimer;
61 bool m_isMeasuring;
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;
76 double m_gyroX;
77 double m_gyroY;
78 double m_gyroZ;
80 void stop();
81 void startMeasurement();
82 void stopMeasurement();
85 #endif // BIASCALIBRATIONUTIL_H