[compasschain] Fix the compass value calculation. Fixes MER#2016
The implementation of compass value calculation in the
compasschain plugin has a bug.
When values of accelerometer and/or mangetometer change, the process of smoothing the compass value is started. It should converge to a new compass value after some time. However, due to invalid data type (int instead of double) this process may converge prematurely due to rounding issues.
For example, if we have a target value
Psi = 90° and current value
oldHeading = 86°, after conversion to
int we will have the next
heading value = 86°, which causes the process to stop.
From the user's point of view this leads to situation, when the user requests the compass value to be 90°, but the resulted value of the sensor is 86° and we cannot manage with it.
So, this merge request changes a type of the
heading variables from
qreal to fix calculation of the compass value.