paiprashanth / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

GPS logging wrong co-ordinates #623

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
There is still a remaining problem to which I have posted several pleas for 
help, but as of now nobody has given me a solution?
When hooked up to mission planner the gps places me in the right place in the 
mission planner view,

When I download my log files using mission planner they are the wrong 
co-ordinates because the longtitude is missing the - sign for example the log 
shows 51.xxxxxxx and 21.xxxxxxx instead of 51.xxxxxxx and -21.xxxxxxxx 
therefore putting me 20 miles or so out.. So when replayed in google earth the 
traces are not anywhere near where I was flying. I really need a solution to 
this as it`s driving me mad... Please help someone...

Original issue reported on code.google.com by aviator...@gmail.com on 5 May 2012 at 3:48

GoogleCodeExporter commented 8 years ago
I also observed the same thing using GPS Emulator.

Original comment by narpat...@gmail.com on 6 May 2012 at 2:27

GoogleCodeExporter commented 8 years ago
is this AP or AC?

Original comment by Meee...@gmail.com on 6 May 2012 at 3:21

GoogleCodeExporter commented 8 years ago
same issue
http://diydrones.com/forum/topics/gps-data-wrong-in-kml-files-need-a-solution

Original comment by Meee...@gmail.com on 6 May 2012 at 4:48

GoogleCodeExporter commented 8 years ago
looks like the problem lies inside this function

// print_latlon - prints an latitude or longitude value held in an int32_t
// probably this should be moved to AP_Common
void print_latlon(BetterStream *s, int32_t lat_or_lon)
{
    int32_t dec_portion = lat_or_lon / T7;
    int32_t frac_portion = labs(lat_or_lon - dec_portion*T7);
    s->printf("%ld.%07ld",(long)dec_portion,(long)frac_portion);
}

Original comment by Meee...@gmail.com on 6 May 2012 at 5:10

GoogleCodeExporter commented 8 years ago
This is with AC although it may also affect AP it depends on where you fly in 
the world I think? if I were to fly from a more westerly position where the (-) 
would not be required in the co-ordinates, it would probably be o.k? obviously 
this is not a solution...

Original comment by aviator...@gmail.com on 6 May 2012 at 7:39

GoogleCodeExporter commented 8 years ago
Just looked at AP and the logs are collected differently
/ Read a GPS packet
static void Log_Read_GPS()
{
    int32_t l[7];
    byte b[2];
    int16_t i;
    l[0] = DataFlash.ReadLong();
    b[0] = DataFlash.ReadByte();
    b[1] = DataFlash.ReadByte();
    l[1] = DataFlash.ReadLong();
    l[2] = DataFlash.ReadLong();
    i = DataFlash.ReadInt();
    l[3] = DataFlash.ReadLong();
    l[4] = DataFlash.ReadLong();
    l[5] = DataFlash.ReadLong();
    l[6] = DataFlash.ReadLong();
    Serial.printf_P(PSTR("GPS: %ld, %d, %d, %4.7f, %4.7f, %d, %4.4f, %4.4f, %4.4f, %4.4f\n"),
                    (long)l[0], (int)b[0], (int)b[1],
                    l[1]/t7, l[2]/t7, 
                    (int)i,
                    l[3]/100.0, l[4]/100.0, l[5]/100.0, l[6]/100.0);

Original comment by aviator...@gmail.com on 6 May 2012 at 7:55

GoogleCodeExporter commented 8 years ago
just some notes
Commit:ccef736710e331aae99673a4ea314ce5cef9d388

* AP_GPS - updated MTK rate to 10Hz and fixed lat/lon printing inaccuracy in 
Arducopter logs and AP_TEST example sketch

thats the commit of change above.

now in that commit it writes the lat and long as a long to the dataflash, this 
part hasnt changed. and is the same as AP
the read has change but only with the / t7 (float) vs T7(define)

so i think the problem comes from the fact that T7(define) is posibly declared 
as a uint. not an int, and loosing the negative in the conversion. but this 
needs testing

Original comment by Meee...@gmail.com on 7 May 2012 at 11:39

GoogleCodeExporter commented 8 years ago
I think the problem lies in the conversion of tlog to KML files, so perhaps a 
task for Michael Obourne.
When I play back the Tlog file in mission planner I am in the right place on 
the map.
This doesn`t work with the Mavlink plugged in it must be removed before playing 
back any Tlog`s, at least on my machine that is the case?

Original comment by aviator...@gmail.com on 8 May 2012 at 4:08

GoogleCodeExporter commented 8 years ago
im confused.
is your problem with tlog to kml
or dataflash logs to kml.

Original comment by Meee...@gmail.com on 9 May 2012 at 12:39

GoogleCodeExporter commented 8 years ago
Both

Original comment by aviator...@gmail.com on 9 May 2012 at 12:43

GoogleCodeExporter commented 8 years ago
can you post a tlog somewhere so i can replicate the problem

Original comment by Meee...@gmail.com on 9 May 2012 at 5:02

GoogleCodeExporter commented 8 years ago
O.K I will post on the DIY drones website in this thread
http://diydrones.com/forum/topics/gps-data-wrong-in-kml-files-need-a-solution

Original comment by aviator...@gmail.com on 9 May 2012 at 4:16

GoogleCodeExporter commented 8 years ago
O.K now posted the files, and in doing so realized I was wrong and the problem 
is just dataflash to KMZ...

Original comment by aviator...@gmail.com on 9 May 2012 at 4:37

GoogleCodeExporter commented 8 years ago
This is finally fixed in trunk so it will be out in the next release (2.6) 
which will be out quite soon.
   http://code.google.com/p/ardupilot-mega/source/detail?r=2feaf454486b1294e92147b9b79c4d04347bdc30

Original comment by rmackay...@gmail.com on 2 Jun 2012 at 3:55

GoogleCodeExporter commented 8 years ago
Well done Randy...

Original comment by aviator...@gmail.com on 2 Jun 2012 at 7:27

GoogleCodeExporter commented 8 years ago
Tested today and still have the same problem?

Original comment by aviator...@gmail.com on 2 Jun 2012 at 5:14