Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57184

Invalid Calibration Level of Magnetometer on Android

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.6.0, 5.7.0
    • Fix Version/s: 5.6.3, 5.7.2
    • Component/s: Sensors
    • Labels:
      None
    • Environment:
      Qt 5.7 / Android 5,6 / LG G2 and Honor 6
    • Commits:
      c4f18f019ee3a72a752361c65904fa1a156e9eb7, 12c11ffb6eb1f68c9c83a6eee3f9d4011746b122

      Description

      Hi,
      I want to read the calibrationLevel() of the Magnetometer to show the user the current accuracy. According to Qt docu this value should be always between 0..1, the higher the more precise and provided the geomagnetic flux density is selected.

      calibrationLevel : const qreal
      This property holds the accuracy of the reading.
      Measured as a value from 0 to 1 with higher values being better.
      Note that this only changes when measuring geomagnetic flux density. Raw magnetic flux readings will always have a value of 1.

      My code:

      SMag::SMag(QObject *parent) : QObject(parent) 
      {
          m_pQMag = new QMagnetometer(this);
          m_pQMag->addFilter(this);
          m_pQMag->setReturnGeoValues(true);
          m_stMag = m_pQMag->start();
      
          connect(m_pQMag,SIGNAL(sensorError(int)),this,SLOT(err(int)));
      }
      
      bool SMag::filter(QMagnetometerReading* reading)
      {
          qDebug() << reading->calibrationLevel(); // 2,3 
      }
      

      The result of calibrationLevel() varies between 2 and 3 and thus out of range. So this means I do not get a valid accuracy value and can not really trust the correction between the raw and geomagnetic flux. Additionally on http://doc.qt.io/qt-5/qmagnetometerreading.html#calibrationLevel-prop the link

      Unknown macro: {See also CS001671 - Calibrating the magnetometer sensor.}

      does not work. I did my tests with a LG G2 and Honor 6, Android 5 and 6.

      Thxs in andvance...

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            stromme Christian
            Reporter:
            tiroler Armin Fuchs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes