Thread: [Algorithms] Low pass filter on quaternions
Brought to you by:
vexxed72
From: John M. <jo...@jo...> - 2010-03-28 03:22:51
|
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 <jo...@jo...> |
From: Robin G. <rob...@gm...> - 2010-03-28 06:35:48
|
Do you want to lowpass the signal, or do you want to fit a smooth curve to the samples? Are the samples regularly spaced? - Robin Green On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan <jo...@jo...> wrote: > 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 <jo...@jo...> > > ------------------------------------------------------------------------------ > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > |
From: Marc B. R. <mar...@or...> - 2010-03-28 07:57:05
|
Also, what do they represent? -----Original Message----- From: Robin Green [mailto:rob...@gm...] Sent: Sunday, March 28, 2010 8:36 AM To: Game Development Algorithms Subject: Re: [Algorithms] Low pass filter on quaternions Do you want to lowpass the signal, or do you want to fit a smooth curve to the samples? Are the samples regularly spaced? - Robin Green On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan <jo...@jo...> wrote: > 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 <jo...@jo...> > > ---------------------------------------------------------------------------- -- > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > ---------------------------------------------------------------------------- -- Download Intel® 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 GDA...@li... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list |
From: John M. <jo...@jo...> - 2010-03-28 15:59:38
|
Hi, Each quaternion represents the orientation of an input device. I want to remove jitter that comes from holding it in a human hand. John On Sun, Mar 28, 2010 at 12:56 AM, Marc B. Reynolds <mar...@or...> wrote: > Also, what do they represent? > > -----Original Message----- > From: Robin Green [mailto:rob...@gm...] > Sent: Sunday, March 28, 2010 8:36 AM > To: Game Development Algorithms > Subject: Re: [Algorithms] Low pass filter on quaternions > > > Do you want to lowpass the signal, or do you want to fit a smooth > curve to the samples? > Are the samples regularly spaced? > > - Robin Green > > > > On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan <jo...@jo...> > wrote: >> 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 <jo...@jo...> >> >> > ---------------------------------------------------------------------------- > -- >> Download Intel® 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 >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> > > ---------------------------------------------------------------------------- > -- > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > > > ------------------------------------------------------------------------------ > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- John McCutchan <jo...@jo...> |
From: Jon W. <jw...@gm...> - 2010-03-28 16:05:40
|
There are open source Wiimote input libraries you could probably take a look at. AFAICT, those generally use very simple, first-order filter type approaches. 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 8:32 AM, John McCutchan <jo...@jo...>wrote: > Hi, > > Each quaternion represents the orientation of an input device. I want > to remove jitter that comes from holding it in a human hand. > > John > > On Sun, Mar 28, 2010 at 12:56 AM, Marc B. Reynolds > <mar...@or...> wrote: > > Also, what do they represent? > > > > -----Original Message----- > > From: Robin Green [mailto:rob...@gm...] > > Sent: Sunday, March 28, 2010 8:36 AM > > To: Game Development Algorithms > > Subject: Re: [Algorithms] Low pass filter on quaternions > > > > > > Do you want to lowpass the signal, or do you want to fit a smooth > > curve to the samples? > > Are the samples regularly spaced? > > > > - Robin Green > > > > > > > > On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan <jo...@jo...> > > wrote: > >> 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 <jo...@jo...> > >> > >> > > > ---------------------------------------------------------------------------- > > -- > >> Download Intel® 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 > >> GDA...@li... > >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > >> Archives: > >> > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > >> > > > > > ---------------------------------------------------------------------------- > > -- > > Download Intel® 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 > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > > > > > > > > > ------------------------------------------------------------------------------ > > Download Intel® 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 > > GDA...@li... > > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > > Archives: > > > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > > > > -- > John McCutchan <jo...@jo...> > > > ------------------------------------------------------------------------------ > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > |
From: John M. <jo...@jo...> - 2010-03-28 18:05:19
|
Hi, Wiimote libraries won't help me. I'm really interested in filtering quaternions directly. Thanks, John On Sun, Mar 28, 2010 at 9:05 AM, Jon Watte <jw...@gm...> wrote: > There are open source Wiimote input libraries you could probably take a look > at. AFAICT, those generally use very simple, first-order filter type > approaches. > 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 8:32 AM, John McCutchan <jo...@jo...> > wrote: >> >> Hi, >> >> Each quaternion represents the orientation of an input device. I want >> to remove jitter that comes from holding it in a human hand. >> >> John >> >> On Sun, Mar 28, 2010 at 12:56 AM, Marc B. Reynolds >> <mar...@or...> wrote: >> > Also, what do they represent? >> > >> > -----Original Message----- >> > From: Robin Green [mailto:rob...@gm...] >> > Sent: Sunday, March 28, 2010 8:36 AM >> > To: Game Development Algorithms >> > Subject: Re: [Algorithms] Low pass filter on quaternions >> > >> > >> > Do you want to lowpass the signal, or do you want to fit a smooth >> > curve to the samples? >> > Are the samples regularly spaced? >> > >> > - Robin Green >> > >> > >> > >> > On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan <jo...@jo...> >> > wrote: >> >> 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 <jo...@jo...> >> >> >> >> >> > >> > ---------------------------------------------------------------------------- >> > -- >> >> Download Intel® 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 >> >> GDA...@li... >> >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> >> Archives: >> >> >> >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> >> >> > >> > >> > ---------------------------------------------------------------------------- >> > -- >> > Download Intel® 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 >> > GDA...@li... >> > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> > Archives: >> > >> > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> > >> > >> > >> > >> > >> > ------------------------------------------------------------------------------ >> > Download Intel® 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 >> > GDA...@li... >> > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> > Archives: >> > >> > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> > >> >> >> >> -- >> John McCutchan <jo...@jo...> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® 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 >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > > > ------------------------------------------------------------------------------ > Download Intel® 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 > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- John McCutchan <jo...@jo...> |
From: Gino v. d. B. <gin...@gm...> - 2010-03-29 08:41:44
|
Note that with any kind of filtering you will introduce some sluggishness since abrupt changes will be muffled. An intuitive way to get this done is through a dynamics simulation. Define inertia for the controlled object and control its orientation through a damped spring. Let Q0 be the current orientation of the object and Q1 the desired orientation (the orientation of the input device). First make sure that Q0 and Q1 are in the same hemisphere (of a 4D unit sphere). Thus if the 4-component dot product of Q0 and Q1 is negative simply set Q1 to -Q1. Next take the relative rotation, which is Qrel = Q0 Q1*, where Q1* is the conjugate of Q1. We will use log(Qrel) the log of Qrel for computing the torque. The log of a quaternion [xyz,w] is the 3-vector xyz * acos(w) / sqrt(1 - w * w) , (log([0, 0, 0: 1]) = (0, 0, 0)). Instead of the log you could also use the vector part (xyz) as a cheap and dirty log, since acos(w) / sqrt(1 - w * w) approaches 1 for w around 1. The torque can now be defined as log(Qrel) * Cspring, where Cspring is the spring constant. You will need to damp out oscillations, by multiplying the relative angular velocity (also a 3-vector) by a damping constant and subtracting it from the torque. If the input device does not provide an angular velocity, you can take a linear approximation of the angular velocity or simply assume a zero angular velocity. By setting the angular damping to 2 sqrt(inertia Cspring), you will get a critically damped spring (just enough damping to remove all oscillations). In an isolated setting you can use inertia = 1 (identity) and tweak the response of the spring damper by changing the spring constant (keeping the damping critical). Just a thought... Gino On 3/28/2010 5:32 PM, John McCutchan wrote: > Hi, > > Each quaternion represents the orientation of an input device. I want > to remove jitter that comes from holding it in a human hand. > > John > > On Sun, Mar 28, 2010 at 12:56 AM, Marc B. Reynolds > <mar...@or...> wrote: > >> Also, what do they represent? >> >> -----Original Message----- >> From: Robin Green [mailto:rob...@gm...] >> Sent: Sunday, March 28, 2010 8:36 AM >> To: Game Development Algorithms >> Subject: Re: [Algorithms] Low pass filter on quaternions >> >> >> Do you want to lowpass the signal, or do you want to fit a smooth >> curve to the samples? >> Are the samples regularly spaced? >> >> - Robin Green >> >> >> >> On Sat, Mar 27, 2010 at 7:14 PM, John McCutchan<jo...@jo...> >> wrote: >> >>> 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<jo...@jo...> >>> >>> >>> >> ---------------------------------------------------------------------------- >> -- >> >>> Download Intel® 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 >>> GDA...@li... >>> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >>> >>> >> ---------------------------------------------------------------------------- >> -- >> Download Intel® 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 >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® 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 >> GDA...@li... >> https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list >> >> > > > |
From: Tom P. <ga...@fa...> - 2010-03-29 15:46:12
|
> The torque can now be defined as log(Qrel) * Cspring, where Cspring is > the spring constant. You will need to damp out oscillations, by > multiplying the relative angular velocity (also a 3-vector) by a damping > constant and subtracting it from the torque. I love springs as much as anybody, but I've never satisfactorily solved the "spike" problem, which is to say if the target value is sufficiently far away from the at-rest current value, the damping doesn't kick in until you've already blasted off into space. I don't remember my calculus well enough to solve this myself, but Game Gems 4 (I think?) has an article on iterative critically damped springs. Unfortunately, critically damped springs also tend to converge very slowly. -tom! -- |