New GPSDriver library

Discussion in 'Official Updates' started by Erel, Nov 4, 2008.

  1. Georg

    Georg Member Licensed User

    yes it is
     
  2. Georg

    Georg Member Licensed User

    i did it already, that works. I am testing this program for 3 month with the old gps.dll and havend had this problem. Now ich changed it to GPSDriver.dll and that was happen

    Onother problem with the GPSdriver.dll. The sealevel in my area is about 40 m. Sometimes when i am driving on the road, the apps shows a sealevel around -200. And now i fear that i moved in submarine :signOops:
     
  3. agraham

    agraham Expert Licensed User

    Then I think I agree with Erel. That bad value must be being sent by the device Intermediate Driver to GPSDriver because GPSDriver does no processing of that data. It comes in to GPSDriver from the Intermediate Driver as a floating point number and is passed to your code as a double length floating point number so the only thing that happens to it is that it is promoted from a single length floating point number to a double length one. This is coded by the C# compiler and I do not believe that it could get that wrong so the data must be bad in the first place - beyond our control by the look of it I'm afraid.
     
  4. bish0p

    bish0p Member Licensed User

    My understanding from reading hte Docs on the new GPSDriver.dll is that the GPSConverter should be exactly the same as the convert section from the GPS.dll.

    When I replace the converter from the GPS.dll with the new GPSDriver.dll in my code the results returned by the WGS84LatLonToUTM function is different (and in my case incorrect).

    Any Ideas what would cause this, or was my first assumption incorrect?
     
  5. agraham

    agraham Expert Licensed User

    I've just knocked up a quick test using the converters from GPS.dll, GPSDriver.dll and my GPSSerial.dll. All should be the same converter using the same source code and for -ve and +ve latitudes the results agree but for negative longitudes they do differ. GPSConverter and GPSSerialConverter are the same, which is not surprising as I copied the code for GPSSerialConverter from the GPSDriver source, but they are different from Converter. Looks like a bug slipped in when Erel amalgamated the sources for GPSDriver.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Let me check it.
     
  7. wolfgang

    wolfgang Member Licensed User

    Converter

    Hi,
    the result for negative longitude values are wrong and there is still the old “0.5 m problem”. Do a test with longitude = 9°, 15°, etc. Attached a converter with mm accuracy (please excuse me but I’m a surveyor).
     

    Attached Files:

  8. agraham

    agraham Expert Licensed User

    :sign0098:A man after my own heart, pedantry rules! :sign0188:
    We'll take over the world - once we've decided which is the very very best way to go about it.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Please try the attached dll and see if it fixes the wrong negative values problem.
    I'll later upload the other files.

    The problem was with the conversion of VB .Net Fix method to C# Math.Floor which gave the wrong results for negative values (one less than what it should returned).
     

    Attached Files:

  10. bish0p

    bish0p Member Licensed User

    That Seems to have fixed it back to what it was is the GPS.dll converter.
     
  11. bish0p

    bish0p Member Licensed User

    It would appear I spoke to soon, it works as the old GPS.dll on the desktop, but is still wrong on the device.
     
  12. agraham

    agraham Expert Licensed User

    It seems to be the same on the device as the desktop for me and it's hard to see how it could be different, are you sure you copied the correct GPS.dll to the device? Nevertheless it is still wrong at -6 degree longitude intervals i.e -6, -12, -18 ... Looks like the implementation of Fix needs a tweak! This is how VB .NET does it.
    Code:
    public static double Fix(double Number)
    {
        
    if (Number >= 0.0)
        {
            
    return Math.Floor(Number);
        
    }
        return -Math.Floor(-Number);
    }
     
  13. bish0p

    bish0p Member Licensed User

    I have replaced the GPS.DLL converter object with the GPSDriver.DLL converter object

    Then I feed the WGS84LatLonToUTM function 51.115180, -114.095520 on the desktop I get 11 U 703283 5666646
    on the device I get 10 U 1122746 5700438

    Both gave the smae results using the converter object in the GPS.DLL
     
  14. agraham

    agraham Expert Licensed User

    I should of course had said "are you sure you copied the correct GPSDriver.dll to the device?" in my previous post :(

    I've just tried your data and I get the same correct result on both desktop and device for the old GPS.dll and the new (but still faulty) GPSDriver.dll. Are you really really sure you don't have the old GPSDriver.dll on the device as that incorrect result is what the original GPSConverter produces.
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    @agraham, You are right of course. My solution didn't work correctly with whole numbers.
    I've updated the file in the first post.
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    @bish0p, please download the updated file in the first post.
    I guess that you've previously tested on the device a compiled application which used the source code of the older library.
    Now after you'll update the source code (cs file) as well, the problem should be solved.
     
  17. bish0p

    bish0p Member Licensed User

    Your right the .cs file had not been updated.
     
  18. 2220

    2220 Member Licensed User

    Hello,

    I'm testing your demo app and it appears an error like 'Error getting device state'
    Error number 87.

    Do you have any ideas?

    Regards.
     
  19. Erel

    Erel Administrator Staff Member Licensed User

    Are you working with an internal GPS?
    Try to comment this line and see if GetGPSDate works.
     
  20. 2220

    2220 Member Licensed User

    Hi Erel,

    Yes it's internal an HTC 3300.

    And I can't see the GetGPSDate as a property.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice