Author Topic: GPS Location Way Off - Suggestions?  (Read 1074 times)

0 Members and 1 Guest are viewing this topic.

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 74
  • Helpful? 1
    • GlitchTech Science
GPS Location Way Off - Suggestions?
« on: January 11, 2012, 02:08:59 PM »
I'm encountering an interesting problem with my GPS data (using EM-406A SiRF). It is reporting my location as near Africa where my actual location is Kansas. Not quite the 10m advertised accuracy. It is reporting at least 3 satellites in view and webbotlib is reporting valid data.

Any clues as to the cause of this? Haven't checked the raw data yet, but I'm currently using webbotlib c++ to parse the NMEA data coming in on UART on my Axon.

If more information would help diagnose and/or resolve this issue, let me know what.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: GPS Location Way Off - Suggestions?
« Reply #1 on: January 11, 2012, 02:58:49 PM »
What happens if you move the device by 20m ? Do the values change? Or are they just fixed no matter what?
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 74
  • Helpful? 1
    • GlitchTech Science
Re: GPS Location Way Off - Suggestions?
« Reply #2 on: January 11, 2012, 09:04:44 PM »
I took it on a bike ride (bad idea, started to snow) and some values changed. After a mile or so, the longitude finally jumped to this side of the pond but still way off even then. The Latitude never changed and neither did the time (except for occasional badly parsed values from the logger side).

SatellitesLatitude / 1000Longitude / 1000Altitude / 1000Time / 1000
4-15.68228.793-14.40416.923
4NaN28.653-13.93316.923
4-15.68228.676-13.21716.923
4-15.68229.23-13.08216.923
3-16.68229.824-13.011NaN
4-15.68230.681-13.13616.923
4-15.68231.242-13.04916.923
4-15.68231.239-11.81716.923
4-15.68231.236-9.61216.923
3-15.68231.366-8.46916.923
3-15.68231.862-8.42416.923
3-15.682-31.696-8.53316.923
4-15.682-32.006-8.60816.923

Here is the code I use to fetch and output the data.

Code: [Select]
razor_imu.read();
sonar.read();
top.read();
gps_main.read();

  //JSON Formatted Output, semicolon signifies end of group
  if( gps_main.isValid() ) {
    //Valid signal

    PRINTF( bluetooth,
        "{'imu': {'gyro': {'x': %d,'y': %d,'z': %d},'accel': {'x': %d,'y': %d,'z': %d},'yaw': %d,'pitch': %d,'roll': %d},
                'sharp': %d,'sonar': %d,'gps': {'satellites': %d,'longitude': %f,'latitude': %f,'altitude': %f,'time': %f}};",
        razor_imu.getGyroX(),
        razor_imu.getGyroY(),
        razor_imu.getGyroZ(),
        razor_imu.getAccelX(),
        razor_imu.getAccelY(),
        razor_imu.getAccelZ(),
        razor_imu.getBearing(),
        razor_imu.getPitch(),
        razor_imu.getRoll(),

        top.getDistance(),

        sonar.getDistance(),

        gps_main.getNumSatellites(),
        gps_main.getLongitudeDegrees(),
        gps_main.getLatitudeDegrees(),
        gps_main.getAltitudeMeter(),
        gps_main.getFixTime()
      );
  } else {

    PRINTF( bluetooth,
        "{'imu': {'gyro': {'x': %d,'y': %d,'z': %d},'accel': {'x': %d,'y': %d,'z': %d},'yaw': %d,'pitch': %d,'roll': %d},
                'sharp': %d,'sonar': %d,'gps': {'satellites': 0,'longitude': -1,'latitude': -1,'altitude': -1,'time': -1}};",
        razor_imu.getGyroX(),
        razor_imu.getGyroY(),
        razor_imu.getGyroZ(),
        razor_imu.getAccelX(),
        razor_imu.getAccelY(),
        razor_imu.getAccelZ(),
        razor_imu.getBearing(),
        razor_imu.getPitch(),
        razor_imu.getRoll(),

        top.getDistance(),

        sonar.getDistance()
      );
  }

I'll try and remember to get NMEA data tomorrow to verify locations.
« Last Edit: January 14, 2012, 02:34:51 PM by Ryltar »

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 74
  • Helpful? 1
    • GlitchTech Science
Re: GPS Location Way Off - Suggestions?
« Reply #3 on: January 14, 2012, 02:25:36 PM »
First, ignore my data saying I was somewhere actually. It was actually 1000 times greater than I said originally (modified table headers to note this).

I (finally) dumped the raw GPS data and it is running fine. But the webbotlib data coming out is not. This is with version 2.08 now.

Output from code (had to change %f to %d as this was causing an issue).
{'satellites': 5,'longitude': 28766,'latitude': -15682,'altitude': -14400,'time': 16923}

NMEA String is valid. I used the raw nmea strings to find my location. If you really want it I can send it, but I prefer the internet don't know exactly where I live.

Data from gps_main.dump();
Valid:Y
Satellites:5
Longitude(degrees):?
Latitude(degrees):?
Track(degrees):?
Altitude(m):?
Speed(knots):?
Time:?
« Last Edit: January 14, 2012, 02:35:57 PM by Ryltar »

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 74
  • Helpful? 1
    • GlitchTech Science
Re: GPS Location Way Off - Suggestions?
« Reply #4 on: January 14, 2012, 02:33:33 PM »
Double post, ignore.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: GPS Location Way Off - Suggestions?
« Reply #5 on: January 14, 2012, 02:39:24 PM »
The reason for the '?' in the output is that Project Designer code gen allows you to select what type of handling you want to support in the C printf commands.
by getting '?' implies that you have told it you dont want it to support floating point numbers - but then you are asking it at runtime to print one. So it just puts '?'
Trying re-generating your code in PD but this time select the 'floating point' radio button in the 'printf options' group.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline RyltarTopic starter

  • Full Member
  • ***
  • Posts: 74
  • Helpful? 1
    • GlitchTech Science
Re: GPS Location Way Off - Suggestions?
« Reply #6 on: January 14, 2012, 02:52:27 PM »
And that did it. I must have changed that setting at some point. Issue resolved and data flowing properly now.

Thanks.

 


Get Your Ad Here

data_list