09-12-2023, 01:41 AM
(This post was last modified: 09-12-2023, 01:52 PM by pietropicerno.)
Hi Jens,
I've just realized that in this experiment quaternions (and, hence, euler angles) are derived from "Acceleration with g" input. This is probably the cause of the inconsistency I found. Question: wouldn't it be easier to retrieve euler angles directl from " SensorManager.getOrientation()"? Note that " SensorManager.getOrientation()" is normally fed by a rotation matrix. The rotation matrix comes from "getRotationMatrixFromVector()" that converts in rotation matrix the output (quaternion) provided either by SENSOR_TYPE_ROTATION_VECTOR (phone's orientation as computed using sensor fusion from acc+gyro+mag) or SENSOR_TYPE_GAME_ROTATION_VECTOR (phone's orientation as computed using sensor fusion from acc+gyro).
PS: I'm not able to write code in Java and I do not know Android platform....so I'm just guessing on the base of what I read so please forgive me in case what I've wrote does not make any sense.
I've just realized that in this experiment quaternions (and, hence, euler angles) are derived from "Acceleration with g" input. This is probably the cause of the inconsistency I found. Question: wouldn't it be easier to retrieve euler angles directl from " SensorManager.getOrientation()"? Note that " SensorManager.getOrientation()" is normally fed by a rotation matrix. The rotation matrix comes from "getRotationMatrixFromVector()" that converts in rotation matrix the output (quaternion) provided either by SENSOR_TYPE_ROTATION_VECTOR (phone's orientation as computed using sensor fusion from acc+gyro+mag) or SENSOR_TYPE_GAME_ROTATION_VECTOR (phone's orientation as computed using sensor fusion from acc+gyro).
PS: I'm not able to write code in Java and I do not know Android platform....so I'm just guessing on the base of what I read so please forgive me in case what I've wrote does not make any sense.