Commit 817780b6 authored by Ivan Shchitov's avatar Ivan Shchitov

[compasschain] Change types of the 'oldHeading' and 'heading' variables inside...

[compasschain] Change types of the 'oldHeading' and 'heading' variables inside CompassFilter from int to qreal. Fixes MER#2016
Signed-off-by: ivanshchitov's avatarIvan Shchitov <ivan.shchitov@fruct.org>
parent 5dcd6fbb
......@@ -105,7 +105,7 @@ void CompassFilter::accelDataAvailable(unsigned, const AccelerationData *data)
/* calculate yaw = ecompass angle psi (-180deg, 180deg) */
Psi = (qAtan2(-fBfy, fBfx) * RADIANS_TO_DEGREES); /* Equation 7 */
int heading = Psi * FILTER_FACTOR + oldHeading * (1.0 - FILTER_FACTOR);
qreal heading = Psi * FILTER_FACTOR + oldHeading * (1.0 - FILTER_FACTOR);
CompassData compassData; //north angle
compassData.timestamp_ = data->timestamp_;
......
......@@ -59,7 +59,7 @@ private:
qreal oldMagZ;
int level;
int oldHeading;
qreal oldHeading;
QList <int> averagingBuffer;
QList <const CalibratedMagneticFieldData *> magAvgBuffer;
QList <const AccelerationData *> accelAvgBuffer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment