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. QGeoPositionInfoSource and QNmeaPositionInfoSource

QGeoPositionInfoSource and QNmeaPositionInfoSource

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 1 Posters 1.3k 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.
  • FerniF Offline
    FerniF Offline
    Ferni
    wrote on last edited by Ferni
    #1

    Hi guys!

    I'm trying to get GPS data from my Android device and I experienced some strange behavior. To get GPS data I used QGeoPositionInfoSource. Altough I set UpdateInterval to 500ms, I receive an update every ~20 seconds. That works when I use AllPositioningMethods (maybe I don't have in my house a good GPS signal but I have a great WiFi signal)

    Then I try to reproduce a GPS log with NMEA messages and in this case I have 2 different problems:

    1. I cannot read my log (probably a format problem, doesn't really matter)
    2. If I set an updateInterval, I can only read ONE message. If I don't set it, I read the entire file without delay between messages.

    Am I the only one who has these problems? Am I doing something wrong?

        source = QGeoPositionInfoSource::createDefaultSource(this);
        if (source) {
            connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
                    this, SLOT(positionUpdated(QGeoPositionInfo)));
    
            source->setUpdateInterval(1000);
            source->setPreferredPositioningMethods(QGeoPositionInfoSource::AllPositioningMethods);
    
            source->startUpdates();
        }
    
        if(source2) {
            source2->createDefaultSource(this);
            QFile* logSource = new QFile(":/logs/nmealog.txt");
            source2->setDevice(logSource);
            source2->setUpdateInterval(500);
    
    
            connect(source2,SIGNAL(positionUpdated(QGeoPositionInfo)),
                    this,SLOT(positionUpdated2(QGeoPositionInfo)));
    
            source2->startUpdates();
    

    My log file was taken from geoflickr example.

    1 Reply Last reply
    0
    • FerniF Offline
      FerniF Offline
      Ferni
      wrote on last edited by
      #2

      Ok, I went out and tested my GPS source. I could get messages every 1 second and that was fantastic.
      I have two question now:

      1. Why 1 second is the limit? Can you read GPS with a frequency of 2Hz or 5Hz? I'd like to track the position of a car and if the speed is 15km/h, I get the position every 4 meters. Where could I find GPS' precision? Maybe the resolution is 10 meters and get position once per second is just fine.

      2. When I'm using AllPositioningMethods, I could get GPS every 20 seconds as I described before. Is this some kind of timeout or what is the problem? My configurable update interval works fine with SatellitePositioningMethods when I go out and get a strong GPS signal.

      Thanks!
      Fernando

      1 Reply Last reply
      0
      • FerniF Offline
        FerniF Offline
        Ferni
        wrote on last edited by Ferni
        #3

        Update:

        The second part of my original post is related to this unresolved bug.

        1 Reply Last reply
        0

        • Login

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