ICM-20948 Problem with rotation vector sign flip

By knseir92 , 18 September 2017

Hello,
We're using the ICM-20948 DMP for a project to get Quaternions. The problem is the sign flips very often (sample value is negated on all four components between two consecutive samples), which creates discontinuities in our signal (image attached).

I am aware that this is a valid representation of a quaternion (since +Q and -Q represent the same orientation), but this representation isn't compatible with our application.

I've read somewhere (https://www.gamedev.net/forums/topic/461253-compressed-quaternions/?do=findComment&comment=4041432) that this is a method of compressing quaternions: the x, y, and z components are sent and the w component is recalculated using the formula x^2+y^2+z^2+w^2 = 1 or w = sqrt( 1- x^2+y^2+z^2 ).
Since w can only have positive values (because of the square root), the signs of all other three components are inverted to indicate that w goes from positive to negative, or the other way around.

Is there a way to represent this differently ? either by having the ICM-20948 send all four components, or by reading a sign bit ?

phpbb Topic ID
36476