Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'compass-value-calculation-patch' into 'master'
[compasschain] Fix the compass value calculation. Fixes MER#2016

See merge request mer-core/sensorfw!34
  • Loading branch information
spiiroin committed Feb 28, 2019
2 parents 971ec5b + 817780b commit 0779c62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chains/compasschain/compassfilter.cpp
Expand Up @@ -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_;
Expand Down
2 changes: 1 addition & 1 deletion chains/compasschain/compassfilter.h
Expand Up @@ -59,7 +59,7 @@ class CompassFilter : public QObject, public FilterBase
qreal oldMagZ;

int level;
int oldHeading;
qreal oldHeading;
QList <int> averagingBuffer;
QList <const CalibratedMagneticFieldData *> magAvgBuffer;
QList <const AccelerationData *> accelAvgBuffer;
Expand Down

0 comments on commit 0779c62

Please sign in to comment.