Continuing to tinker with my IMU fusion code. I'm currently playing with improving the data cleaning before the calibration process. In the ideal world (where calibration isn't necessary) the vector length of each point would be equal. Obviously that's not the case (and it part of what calibration is trying to achieve), but eliminating vector lengths with extremely small or large values seems like a good approach to removing outliers.
_filterPoints: function(points)
{
const sqlengths = points.map((point) => {
return point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
});
const mean = MATH.mean(sqlengths);
const std = MATH.std(sqlengths);
const low = mean - std;
const high = mean + std;
const fpoints = points.filter((point, idx) => {
return sqlengths[idx] > low && sqlengths[idx] < high;
});
return fpoints;
}
The above code does just this and, in some limited testing so far, seems to produce a more accurate and stable quaternion result.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Looks like 2 standard deviations offers better accuracy than just 1.
Are you sure? yes | no