# Thread: speed from GPS show wrong value

1. ## speed from GPS show wrong value

Hi.
I'm writing application that gets latitude, longtidute and speed from GPS. Everything withount speed works great. If I drive a car, speed my GPS speed counter shows incorrect value (error is about 20 km per hour, 20km/h less than it should be). When I'm walking, my application speed counter shows 3-7 km/h, and when I'm standing speed is 0-3 km/h.
I checked results against Nokia default application. Difference between my speed and speed showed by nokia is about 5 km/sek( so I can accept that difference).
Here is my code for symbian(nokia n95):

Every 1 sec i get GPS data:

Code:
```iPosInfoBase = &iSatelliteInfo;
iPositioner.NotifyPositionUpdate( *iPosInfoBase, iStatus );
SetActive();```
and this is RunL()

Code:
```void CGPSConnect::RunL()
{
if(!IsActive())
{
...
iSatelliteInfo.GetPosition(iPosition);
...
}
}```
I used to calculate speed
TPosition.speed(TPosition, speed);
but with the same result .

Any idea what can I to do now?

Samos

2. ## Re: speed from GPS show wrong value

are you handling the speed as KM's or as m/s ?

3. ## Re: speed from GPS show wrong value

I`ve convert meters pers second on kilometerns per hour.

Code:
```TCourse course;
iSatelliteInfo.GetCourse(course);
TReal32 speed = course.Speed();
speed = speed * (36/10);```

4. ## Re: speed from GPS show wrong value

would it change anything if you would use:

speed = (speed * 36)/10;

5. ## Re: speed from GPS show wrong value

It changed nothing, because multiplication doesn't really rely on order of data (only there's problem if there's addition or substraction). the brackets are not changing a thing from mathematical point of view.

the problem must be somewhere else.

6. ## Re: speed from GPS show wrong value

I would at least try that out, since it depends on how the values are handled, and I'm not 100% sure that they would be handled as real, when the values used are not.

7. ## Re: speed from GPS show wrong value

speed is TReal32. To display speed I convert it on TBuf:

Code:
```_LIT(KFormatSpeed," %2.1f km/h");
...
TBuf<255> buffer;
buffer.Format(KFormatSpeed,aSpeed);```
convert that:

Code:
```TReal32 a;
TBuf<255> buf;
a = aSpeed;
TRealFormat format;
buf.Num( a, format );```
with the same result.

8. ## Re: speed from GPS show wrong value

Hi,
I have a similar app but I calculate the speed manually and looks the speed are almost correct.
For test purpose you could try manually to see the result.

9. ## Re: speed from GPS show wrong value

Originally Posted by mahbub_s60
Hi,
I have a similar app but I calculate the speed manually and looks the speed are almost correct.
For test purpose you could try manually to see the result.
i'm not used GPS before but i freshman
u can give us some start example about GPS but i hope work fine, also
can i determine one mobile from another by using GPS by establish a program on a mobile and another in the second and the 1st search to 2nd by IMEI or another thing

10. ## Re: speed from GPS show wrong value

Instead of asking for snippets over and over why don't you check the Wiki which is full of such examples, tutorials and reference.

11. ## Re: speed from GPS show wrong value

Originally Posted by MobiSecLap
i'm not used GPS before but i freshman
u can give us some start example about GPS but i hope work fine, also
can i determine one mobile from another by using GPS by establish a program on a mobile and another in the second and the 1st search to 2nd by IMEI or another thing
Could you check wiki and example sections of Forum Nokia web pages. There are some examples there.

What are you talking about IMEI? From Satellite we can get only location information. We don't have connection from one device to another device directly. But we can built such a services via some server (like location related services work)

12. ## Re: speed from GPS show wrong value

Originally Posted by mahbub_s60
Could you check wiki and example sections of Forum Nokia web pages. There are some examples there.

What are you talking about IMEI? From Satellite we can get only location information. We don't have connection from one device to another device directly. But we can built such a services via some server (like location related services work)
can we know device location by another device?

13. ## Re: speed from GPS show wrong value

Originally Posted by MobiSecLap
can we know device location by another device?
Not unless you desing and implement a communication method where the another device locates itself, and then tells you its location. Basically mobile operators can at least in theory locate any device rather accurately, since they own the network and can utilize it as they wish (of course same time following all laws), but those services are usually not given to outsiders.

14. ## Re: speed from GPS show wrong value

Operator can estimate the location roughly based on the tower location. No direct way to locate from another device
This option is visible in settings as network based.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•