New GPSDriver library

Georg

Member
Licensed User
Longtime User
It looks like a problem between the GPS hardware and the driver.
You can filter out results where the latitude is not between +-180.

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:
 

agraham

Expert
Licensed User
Longtime 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.
 

bish0p

Member
Licensed User
Longtime 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?
 

agraham

Expert
Licensed User
Longtime User
the results returned by the WGS84LatLonToUTM function is different (and in my case incorrect)?
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.
 

wolfgang

Member
Licensed User
Longtime 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).
 

Attachments

  • geo_utm.sbp
    3.5 KB · Views: 15

Erel

B4X founder
Staff member
Licensed User
Longtime 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).
 

Attachments

  • GPSDriver.zip
    7.2 KB · Views: 19

bish0p

Member
Licensed User
Longtime 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).

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

agraham

Expert
Licensed User
Longtime 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.
B4X:
public static double Fix(double Number)
{
    if (Number >= 0.0)
    {
        return Math.Floor(Number);
    }
    return -Math.Floor(-Number);
}
 

bish0p

Member
Licensed User
Longtime 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.

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
 

agraham

Expert
Licensed User
Longtime 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.
 

bish0p

Member
Licensed User
Longtime 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.

Your right the .cs file had not been updated.
 

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.
 

2220

Member
Licensed User
Hi Erel,

Yes it's internal an HTC 3300.

And I can't see the GetGPSDate as a property.
 
Top