Quaternion with one euro filter

437 views
Skip to first unread message

vr.engeen...@gmail.com

unread,
Nov 14, 2013, 3:35:03 PM11/14/13
to vr-g...@googlegroups.com
Hi all,

I'm trying, as an exercise, to send my handled device gyroscope value with UDP to a computer. No problem, it send value, my computer receive and begin rotation according to device orientation.

I use the one euro filter to smooth data I send every 0.1s. The problem is that with a certain orientation, quaternion flips and then, my computer with its one euro filter "interpolate" flip values and produce a quick "ping pong" rotation of my 3D linked object.

Same problem with Angle Axis value, when feeding with quaternion, if my quaternion flips, the angle axis flips to.

Do you have an idea on to prevent angle value flip in certain condition? (It should be only one condition, others rotations are ok)

Thanks a lot

Nicolas

vr.engeen...@gmail.com

unread,
Nov 14, 2013, 4:05:00 PM11/14/13
to vr-g...@googlegroups.com
Hey all,

Sorry for the matter. I just found the solution using Dot product of past frame quaternion and current one. If the result is negative, I inverse the current quaternion... it seems working really well...

Do you have any comment on this? I was thinking quaternion was "the unique good" solution to write rotation... but it flips likes other Euler angles ?!?

I'm impatient to read you

Nicolas

Jan Ciger

unread,
Nov 14, 2013, 4:27:27 PM11/14/13
to vr-g...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On 11/14/2013 10:05 PM, vr.engeen...@gmail.com wrote:
> Hey all,
>
> Sorry for the matter. I just found the solution using Dot product
> of past frame quaternion and current one. If the result is
> negative, I inverse the current quaternion... it seems working
> really well...
>
> Do you have any comment on this? I was thinking quaternion was
> "the unique good" solution to write rotation... but it flips likes
> other Euler angles ?!?

The problem is most likely not in the quaternion itself (assuming you
are doing the math correctly), but in your IMU/gyro.

Are you sure that the math you are using handles the situation when
the angle is more than 180 degrees? Many IMUs will flip signs in that
case, causing discontinuity, especially if the raw data are coming as
3 separate values (one for each axis) and not as a quaternion or
axis/angle combination already. A typical case is that the reported
angle is always between -90 to +90 degrees and if you need angles >
+-90 degrees, you have to do the type of hack that you have done.
Check the documentation for your device to be sure.

Regards,

Jan




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iD8DBQFShUA7n11XseNj94gRAu0qAKDHRG7bU6b1IsQhh2yVL9VhOd9nswCfTvm5
5AZ15TVCCsf334OCXj467A4=
=BRnG
-----END PGP SIGNATURE-----

Ryan Pavlik

unread,
Nov 15, 2013, 2:04:40 PM11/15/13
to vr-g...@googlegroups.com
Also, you can't just filter a quaternion as if it were a 4d vector. You can look at what myself and Jan put together in the VRPN source code for applying the one-euro filter to quaternions: basically you have to reframe the low-pass filter in terms of interpolation, and be mindful of keeping things normalized.

Ryan



--
You received this message because you are subscribed to the Google Groups "VR Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vr-geeks+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/vr-geeks.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages