Commit 0779c624 authored by spiiroin's avatar spiiroin

Merge branch 'compass-value-calculation-patch' into 'master'

[compasschain] Fix the compass value calculation. Fixes MER#2016

See merge request !34
parents 971ec5bd 817780b6
......@@ -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