OSVR-fusion icon indicating copy to clipboard operation
OSVR-fusion copied to clipboard

Implements a Complementary Filter for intelligently fusing yaw from multiple sources

Open nanospork opened this issue 7 years ago • 4 comments

This PR implements a complementary filter (a straightforward introduction here: http://www.pieter-jan.com/node/11) that allows for intelligent fusion of yaw data from a "fast" source with data from an "accurate" source.

The complementary filter is more or less equivalent to one of the most basic implementations of the Kalman filter (http://www.olliw.eu/2013/imu-data-fusing/). The complementary filter high-passes data from the "fast" source while low-passing data from the "accurate" source, creating a signal that is responsive in the short term while remaining accurate in the long term.

The complementary filter is tuned with a simple "alpha" parameter. I've added an example to the readme that shows what terms to add to the orientation object within the server config file.

A recenterButton object can also be added to the orientation object. This object points to a semantic path such as a controller button. The FilteredOrientationReader then listens for a button press on this path and if one is detected and there is significant error between the last filter input and the current input, the filter will instantly backfill to the new input. In short, this is an attempt to detect external yaw recentering in the "accurate" yaw source and provide the user with a "snappy" recentering experience, rather than allowing the filter to slowly recenter the device (and cause nausea if used with an HMD).

I've been working on this as part of a larger project I'm (tentatively) calling NOFC - the Nolo OSVR Fusion Configuration, which takes advantage of the Nolo-OSVR plugin, the OSVR-Fusion plugin, and an update to the SteamVR-OSVR plugin for much better performance using Nolo hardware with OSVR.

I think you'll find that this new filter is right at home in OSVR-Fusion, and that it will allow users to improve their yaw performance not just with Nolo and the HDK, but with a number of other hardware configurations as well.

Let me know if you have any questions about how the filter works, or if there are any changes you would like to see or discussion you would like to have before merging!

nanospork avatar Aug 18 '17 05:08 nanospork

Looks good. Can't review code until late September (sorry) so talk then.

simlrh avatar Aug 18 '17 11:08 simlrh

Do you want maintainer on OSVR-fusion? I’m working full time and can’t make it to my workshop often

simlrh avatar Dec 02 '17 08:12 simlrh

Sure! I’m in the same situation, but I suppose two of us getting to it infrequently is better than one? ;)

nanospork avatar Dec 02 '17 22:12 nanospork

Ok, you have push access, go nuts!

simlrh avatar Dec 03 '17 16:12 simlrh