Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Invalid Calibration Level of Magnetometer on Android

Invalid Calibration Level of Magnetometer on Android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 647 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PowerNowP Offline
    PowerNowP Offline
    PowerNow
    wrote on last edited by
    #1

    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

    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.

    Does maybe someone has an idea?

    Thxs in andvance...

    PowerNowP 1 Reply Last reply
    0
    • PowerNowP PowerNow

      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

      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.

      Does maybe someone has an idea?

      Thxs in andvance...

      PowerNowP Offline
      PowerNowP Offline
      PowerNow
      wrote on last edited by PowerNow
      #2

      For who is interested, find the answer under https://bugreports.qt.io/browse/QTBUG-57184

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved