Re: Low pass filter on quaternions

Jason Hughes <[email protected]> Sun, 28 Mar 2010 14:41:56 -0500
Newsgroups gmane.games.devel.algorithms
Organization Steel Penny Games, Inc.
Message-ID <[email protected]>
The typical way to handle Wiimote pointer jitter (2D) is to attach a 
simple bimodal spring to the XY position on screen.  The clamped mode is 
enacted anytime the centroid of the last few samples is within some 
squared tolerance of the samples; return the centroid as long as that's 
true.  When the most recent sample deviates, spring toward the current 
sample value by lerping toward it at about 30% per frame for a few 
frames, after which you just return the current sample.  This gives a 
smooth transition between the modes.

For motion control, we tended to handle the smoothing within each object 
control rather than at the hardware driver level, since there were some 
control schemes that look for spikes and thresholds, and any kind of 
filters we applied would ultimately mask those sorts of details.

I do recall that we tried various methods for smoothing.  One of them 
maintained two axes in space for the up and forward.  They were allowed 
to drift away from orthonormal while smoothing points in space, since we 
did non-linear smoothing.  When returning the orientation of the remote 
to the game, we would re-orthogonalize the orientation by holding the 
"important axis" fixed--that is, the one that the user is primarily 
interested in controlling cleanly during the current activity--without 
modifying the internal axes we were tracking.

Seemed to work ok, but again, the technique should probably match the 
control in each section of the game.

JH

Jason Hughes
President
Steel Penny Games, Inc.
Austin, TX


On 3/28/2010 12:58 PM, Jon Watte wrote:
> The problem is that Quaternions are not quite linear enough. Running a 
> naive filter on the axis component when the rotation is close to 
> identity (and the axis component is small) may cause excessive jitter.
>
> The motion capture tools people have had this problem for a long time. 
> I believe they convert to Euler, and run low-pass filtering there 
> (possibly higher than just first order), and then convert back, 
> because Euler is less sensitive around any particular spot.
>
> I'd also be interested in hearing from anyone who has done this in anger!
>
> Sincerely,
>
> jw
>
>
> --
> Americans might object: there is no way we would sacrifice our living 
> standards for the benefit of people in the rest of the world. 
> Nevertheless, whether we get there willingly or not, we shall soon 
> have lower consumption rates, because our present rates are 
> unsustainable.
>
>
>
> On Sun, Mar 28, 2010 at 10:22 AM, Juan Linietsky <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     I don't have any code handy, but since for a lowpass filter you
>     need the "difference",  I guess you can obtain that with the
>     inverse or something similar.. Also keep in mind it may be easier
>     to just lowpass a 3x3 matrix since you want to rule out high freq
>     noise
>     ------Original Message------
>     From: John McCutchan
>     To: Game Development Algorithms
>     ReplyTo: Game Development Algorithms
>     Subject: [Algorithms] Low pass filter on quaternions
>     Sent: Mar 27, 2010 23:14
>
>     Hi,
>
>     I have a sequence of quaternions and want to filter out any high
>     frequency changes. I'm wondering if anyone has a paper or some code
>     for performing a low pass filter on quaternions?
>
>     Thanks,
>     --
>     John McCutchan <[email protected]
>     <mailto:[email protected]>>
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     GDAlgorithms-list mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
>     Archives:
>     http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
>
>     ------------------------------------------------------------------------------
>     Download Intel&#174; Parallel Studio Eval
>     Try the new software tools for yourself. Speed compiling, find bugs
>     proactively, and fine-tune applications for parallel performance.
>     See why Intel Parallel Studio got high marks during beta.
>     http://p.sf.net/sfu/intel-sw-dev
>     _______________________________________________
>     GDAlgorithms-list mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
>     Archives:
>     http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
> _______________________________________________
> GDAlgorithms-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
> Archives:
> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev

_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list