Close

Alternate IMU data filtering

A project log for 8BitRobots Module

A common hardware, software and 3D printed module to enable fun, educational robots anyone can print and program.

Tim WilkinsonTim Wilkinson 11/21/2018 at 21:101 Comment

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

Tim Wilkinson wrote 11/22/2018 at 00:53 point

Looks like 2 standard deviations offers better accuracy than just 1.

  Are you sure? yes | no