cancel
Showing results for 
Search instead for 
Did you mean: 

Compass heading stuck at 0° — Fusion HAL not generating geomagnetic rotation vector

Santhu
Visitor

 

We have integrated LSM6DSV16X (IMU) and ISM303DAC (magnetometer) on Android 10 running on the NXP i.MX8MM EVK.
The magnetometer and accelerometer, gryoscope drivers are working correctly, and raw values are verified using sysfs and logcat.

However, the compass heading is always 0°, and the GEOMAGNETIC_ROTATION_VECTOR output from the STM fusion HAL remains constant, even though the raw sensor data is correct.

Observed Behavior:

  • Raw ACC, GYRO, MAG readings are valid and updating.

  • Android framework registers all sensors correctly.

  • But heading never changes in any compass or mapping application.

  • Rotation Vector, Geomagnetic Rotation Vector, and Orientation sensors always report zero output (all axes = 0).

    Issue in Fusion HAL:

    The STM software fusion implementation (SWAccelMagnGyroFusion9X + STMSensorsFusion) contains only placeholder stubs for the main functions

     int STMSensorsFusion::getQuaternion(...)
int STMSensorsFusion::getEulerAngles(...)
int STMSensorsFusion::getGravity(...)
int STMSensorsFusion::getLinearAccel(...)
All of them simply return 0 without performing any fusion calculations, resulting in no quaternion and no heading update.

So, although our drivers (LSM6DSV16X + ISM303DAC) are correct, the fusion layer never produces geomagnetic orientation or heading.

Driver and HAL Source References

Please find below the exact repositories/paths used (these are where we downloaded or referenced your open-source implementations):

1. LSM6DSV16X (Accel/Gyro) 

2. ISM303DAC (Magnetometer)

  • Driver Source:
    https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio/tree/master

  • HAL Source Path:
    https://github.com/STMicroelectronics/st-mems-android-linux-sensors-hal

    Requested Support

    Please provide:

    1.  A working sensor fusion library (or compiled binary) compatible with LSM6DSV16X + ISM303DAC.

    2. Example implementation for:

      • getQuaternion()

      • getEulerAngles()

      • getGravity()

      • getLinearAccel()

    3.  Documentation/samples showing how to enable fusion for this sensor combination.

    4. Confirmation whether the current HAL requires additional proprietary components not included in your open-source release.

    I have attached the  which has the dumpsys sensorservice which is showing that rotation vector / geomagnetic rotation vector sensors are not registered.
    This confirms the fusion module is not generating quaternion or orientation data, even though raw accel/gyro/mag data is correct.



0 REPLIES 0