Shop OBEX P1 Docs P2 Docs Learn Events
Google Earth GPS SD Card Logger - COMPLETE! — Parallax Forums

Google Earth GPS SD Card Logger - COMPLETE!

Paul_HPaul_H Posts: 85
edited 2009-12-26 03:51 in Propeller 1
Hi All,

As my apparent obsession with GPS continues, I have created this Google Earth SD Card Logger for you all to play with. This will create GPS logs that are directly usable in Google earth with no additional processing. I have copied a test log KML file for those without SD card hardware and an image from Google Earth as well.

You will notice that the 3D plot sometimes disappears below the ground image. This is because of the accuracy of GPS altitude. Is it often 'off' by more than a meter. Since I was riding a bike around the block to collect data, an error of -1m could easily put the line underground. To see all data in GE, right click DATALOG at the left menu at the bottom, and select PROPERTIES, then play with the altitude settings.

Enjoy,
Paul


*** UPDATE - the .kml file is in the ZIP. the forums software won't let me post .kmls directly. ***

Post Edited (Paul_H) : 6/5/2008 5:10:32 AM GMT

Comments

  • CassLanCassLan Posts: 586
    edited 2008-06-05 00:34
    This is way cool, I have a buddy who spent so much $$ on a GPS logger for his car just so he could plot in google maps.

    I Can't wait to compare the 2!!



    Rick-
  • bboy8012bboy8012 Posts: 153
    edited 2008-06-05 02:21
    Awsome job Paul I cant wait to try it as soon as I get my gps in my plane. I'm to lazy to ride my bike around my block Ha Ha Ha!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Hunger hurts, starvation works!
  • csfancsfan Posts: 14
    edited 2008-06-05 03:30
    Works great sitting stationary in my apt! I had to change the serial mode from 0 to 1 as noted in the start method in GPS_IO_mini_PNAV.spin for my Garmin eTrex. Can't wait to play with this on my road trip this weekend.
  • Paul_HPaul_H Posts: 85
    edited 2008-06-05 05:04
    @bboy - Real Plane or R/C? Mine will eventually fit into FrankenPlane, my R/C electric. My secret plan is to be able to READ Google Earth files the drive wayponts. One at a time!

    @csfan - Good catch - I hadn't tried this with my old etrex but the mode has tripped me up in the past.

    Have Fun!
    Paul
  • BaggersBaggers Posts: 3,019
    edited 2008-06-05 09:10
    Hi Paul, it's looking good [noparse];)[/noparse]

    I remember a few years back now (which was way before google earth.), I reverse engineering the Microsoft Flight Sim 2002 VFR aerial photography add on packs, and figured out the filename structure, and the file contents [noparse];)[/noparse] and re-packed them even smaller, and put all of england and wales textures onto a 4GB ( largest CF at the time and cost a £200 about $400 ) and wrote a Pocket PC app for my compaq [noparse];)[/noparse] to display the textures in 2D and 3D and reading my navman gps data, and allowing me to have the first (that I know of, as even to this day, tomtom still doesn't have it) satnav with aerial photography. [noparse]:)[/noparse]

    Seeing your pic reminded me of it [noparse]:)[/noparse] great fun isn't it.

    Baggers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-06-05 10:12
    Baggers for prime minister!
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2008-06-05 11:29
    Oh yes and a totally awesome app. I am sorely tempted to add one to my bicycle along with a dynamo and small battery so it logs all my riding automatically.

    Graham
  • BaggersBaggers Posts: 3,019
    edited 2008-06-05 12:28
    Thanks Graham, but I'd rather it went to Geremy Clarkson [noparse];)[/noparse] he'd run the country better. besides, I'd deffo not have time to Prop then [noparse]:([/noparse] lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-05 14:04
    As a note, there is a switch option in the KML file to flatten the line to ground level if you want. You won’t see altitude, but it also keeps it from disappearing underground. Nice work though!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • vampyrevampyre Posts: 146
    edited 2008-06-06 00:26
    i have to get gps now. thats a really nifty application. riding a bike isn't my style (requires actual excersize) but would be great my RC airplane. I can imagine doing skywriting and then being able to save it. too cool.
  • rjo_rjo_ Posts: 1,825
    edited 2008-06-06 00:39
    Thank you, thank you, thank you.

    I have a version of same that runs on a Mac... but my EX... is a Windows only girl and I didn't have a clue what to do next.

    Perfect.
    When I ran the KML file on a Mac I get an error message: Fetch of networkling 0103231221 failed, etc. etc.

    So... at least on a Mac you have to have Google Earth up and running first

    ... so cool.

    Rich

    Baggers,

    Sorry to hear that you are not available. But I completely agree with you about Jeremy Clarkson.

    ...http://asadodo.blogspot.com/2006/09/jeremy-clarkson-1960-2006.html

    I have written to Mr. Clarkson to recommend that once he has taken his rightful office that he tap you to help him re-shuffle the Bank of England. You are going to need a Prop-based economic simulation: Think of a Lada, with an ejection seat, hitting a wall at 100 knots.

    Post Edited (rjo_) : 6/6/2008 1:55:02 AM GMT
  • jqjq Posts: 9
    edited 2008-06-06 14:08
    That's a very nice application, and the extensions are endless.
    Actually bought a propeller to try (after learning how to talk to it!) and build something very much like this.
    I'd like to have a real time map overlay (the kml part of this) that would provide position along with sensor data (say temperature as a start).

    As a step toward that - and a way to resolve the altitude issue, could you set the line color to the elevation in the kml, while plotting the line flat against the topography?
  • GreyBox TimGreyBox Tim Posts: 60
    edited 2008-06-06 18:02
    I resume you are using a GPs receiver only (no DR...).

    Why not build an add-on for your GPS to do XYZ accelerometers and yaw gyros? Put in some XYZ magnetic heading sensors and you can get much better accuracy
    (using a kalman filter) than you ever would with a stand-alone GPS receiver (plus if you lost "3D" tracking from the sky - the kalman filter would bias towards the
    inertial information from the accelerometers).

    My 2 cents...

    -Tim

    P.S. if you frankenstien a digital camera to hook it up to the Propeller, you can have it take pictures at intervals, and with time stamps from the GPS you can either later add geotagging info to the pictures... -T
  • Paul_HPaul_H Posts: 85
    edited 2008-06-06 20:38
    I'm pleased this has been received so well and I love all the ideas.

    @Baggers - We must be too old - The "I remember when..." stories that I heard usually involved walking uphill both ways to school, and never involved reverse-engineering of anything! But your point is absolutely on point - This IS Fun!!

    @Chris is correct about the options in the header.txt file. You can change these to look anyway you like the GE maps to be displayed. I went with simple and small for my use, but if you study up on KML, you can mod the headers to your preferences. I had considered embedding the KML in a DAT records which would greatly improve speed but not be easily adjustable in the field, or allow much onboard memory for anything else.

    @Vampyre & Tim - You may like to see my main project site for my UAV at www.pnav.net. I already fly first person with a camera onboard from the pilot's perspective, and will have some of the automation put into the projects like an OSD/HUD overlay on the live feed, etc. I do like the suggestions.

    thanks all!
    Paul
  • BaggersBaggers Posts: 3,019
    edited 2008-06-07 11:16
    Paul, Lol, yeah, still a young 39, [noparse]:)[/noparse] but didn't want to go back to a real I remember when... as I've slept once or twice since then and it may be faded now lol.

    Jim.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • ClemensClemens Posts: 236
    edited 2008-06-07 12:38
    Thanks Paul for sharing, got it running with my Garmin GPS 60 by changing the mode like csfan suggested. smile.gif
  • LtechLtech Posts: 366
    edited 2009-05-23 08:24
    Hello, thanks for this code.

    I think there is a bug here in Europe.
    The klm file is +/- right for latitude but wrong for longitude

    I life in Anwerp (Belgium) but with this code i am in the sea near uk !

    >On the video I have 5110.0072 lat and 00426.9009 lon
    >On a garmin gps N 51°09.998' and E 004°26.913
    >On google Earth 51.166720 and 4.448401

    On the same hardweare i use gps-float-lite demo an d have:
    > 51.11678 and 4.448414


    pice of klm code
    >"<tessellate>1</tessellate>
    <altitudeMode>absolute</altitudeMode>
    <coordinates>-04.448431,51.166779,25.4 -04.448433,51.166787,25.8 -04.448439,51.166789,25.2 -04.448444,51.166786,24.7 -04.448433,51.166779,24.9
    04.448426,51.166759,21.5 -04.448431,51.166762,21.2 -04.448438,51.166756,19.9 "


    Any sugestion

    Thanks


    Found:


    On line 158 : SDwrite(string("+")) ' Correct sign for Europe hemisphere, manually for now


    tongue.gif

    Post Edited (Ltech) : 5/23/2009 10:56:37 AM GMT
  • ProFlyerProFlyer Posts: 1
    edited 2009-05-23 15:11
    Thanks Paul_H! Great work...
  • mctriviamctrivia Posts: 3,772
    edited 2009-05-23 16:11
    GreyBox Tim said...
    P.S. if you frankenstien a digital camera to hook it up to the Propeller, you can have it take pictures at intervals, and with time stamps from the GPS you can either later add geotagging info to the pictures... -T

    My Nikon D200 has a jack on it to connect to my remote control and Garmin 60CSX. I can program the camera to take pictures at intervals of up to 5 pictures per second and it will automatically tag the photos with the GPS cowardinatants, number of satellites used, and estimated accuracy.

    Still that is about $1900 worth of equipment(not including lens). The prop could make much cheaper I am sure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    propmod_us are now in stock. propmod_1x1 arrive on 26th. Only $30

    Need to upload large images or movies for use in the forum. you can do so at uploader.propmodule.com for free.
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-12 10:13
    I just tried this out in Northern California (near Parallax even) and have formatting erros with the logged data. For example:

    When I am at 38.775919, -121.358600

    It logs "- 21.358600,38.775919,00032.8"

    So it seems it is dropping the 1 from the 121 and the lat/lon are swapped???? When I load the KML file from my ride home from work, it says I was in the middle of the Red Sea. it was raining, but not that bad...


    Any advice on where to start looking for fixes? I will be looking at what LTech found.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • grins73grins73 Posts: 17
    edited 2009-12-12 10:47
    wow!
    That GPS app sounds like a realy awsome project, I will try it some time in the near future. For now it seems a bit above me. im still trying to figger out how to get the prop to read the parallax GPS in "smart mode"

    its great to see ppl realy going full tilt on this stuff though. I hope that oneday I will come up with somthing as cool as this
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-13 08:19
    I think I have a lead as to the bug in the code. I believe it's in the Longitude writing section here:

    DD     := num.ToStr(atoi(gps.longitude,3),Num#DEC3)   ' whole degrees - DEC# is the number of digits needed in the string
      SDwrite(string("-"))                                  ' Correct sign for western hemisphere, manually for now
      if atoi(gps.longitude,3) > 99                         ' Write whole characters to the file that's open.
        sdfat.pputc(byte[noparse][[/noparse]DD+0])                             ' Write hundreds IF applicable
    



    In digging into the atoi (format.spin) and ToStr (numbers.spin) callouts, it appears the first line in the code above will convert "-121" to "121" then dump the first digit leaving a space. So, even though "atoi(gps.longitude,3)" is "> 99", the next line of code writes a space to the SD card instead of a 1.

    I think that's correct, but I will need to look at it some more. If I am right though, I don't know how to fix it. cry.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-16 17:58
    I now have this program working properly (for Northern California anyhow). The bug was in the section of code previously mentioned. Attached is my code which includes the 6 versions it took me to get it working. I attached all the versions in case someone wanted to see my debugging process. Basically I started playing around with tht section of code and even duplicated it so that the log file would have multiple logs of the same data, but formatted differently by the code. (dump the .zzz on the zip file to open it)

    Now it's time to start working on the code to have it verify it's location from stored data for the Reverse Geo-Cache Project

    update:
    NOTE: The attached code (final version 006) does not create a properly formatted KML file (see my next post).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010

    Post Edited (WBA Consulting) : 12/17/2009 8:22:30 PM GMT
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-17 20:18
    Well, after some further checking, I discovered that my program technically isn't correct yet because the file will not load into Google Earth. The problem is with the KML header/footer formatting. I started looking into KML coding references last night and through the examples, learned how to code KML. Attached is my new file that loaded right into Google Earth. I now need to update the header, footer, and program to create what I made manually, but I am going to clean up the KML a little further.

    One thing I discovered is that the longitude should be first, not second like I thought was the bug. So the coordinate data should look like:
    -121.392849,38.713888,55 -121.392500,38.713000,30
    


    which is longitude, latitude, altitude, then a space (no spaces between data, only between coordinate chunks(technical term))

    I also found out that the altitude is not required and when it is used, you cannot use the absolute mode of altitude formatting if you also have tesselate set to 1. So, I changed the altitude mode to "ClampToGround".


    I'll be updating my program when I get a chance and post updated code with a propeller created KML file.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010

    Post Edited (WBA Consulting) : 12/17/2009 8:23:39 PM GMT
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-18 01:31
    Updated the program by switching the longitude and latitude again (longitude first) and updating the fake dat section that has copies of the kml that needs to be in the header and footer text files on the uSD card. Trying it out in a few minutes, but I believe it's correct.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010
  • WBA ConsultingWBA Consulting Posts: 2,933
    edited 2009-12-18 06:40
    Confirmed that the code worked. Here's a snapshot of part of my ride home and the kml file. There's a straight line stretch in the beginning (north-eastern) because the GPS lost satellite lock. This seems to be an issue with my current setup, not sure if it's caused by having the GPS modules so close to the demo board. It will take a few minutes to lock at power up and then intermittently drop sat-lock. Hopefully that will go away with a clean install in the case.


    UPDATE: I have now confirmed it was my setup. It went away when I put the GPS module onto my PPDB. With nothing underneath it now but the breadboard, I get a solid GPS lock inside the house near the front window.

    .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andrew Williams
    WBA Consulting
    WBA-TH1M Sensirion SHT11 Module
    Special Olympics Polar Bear Plunge, Mar 20, 2010

    Post Edited (WBA Consulting) : 12/19/2009 9:53:12 AM GMT
  • Paul_HPaul_H Posts: 85
    edited 2009-12-26 03:51
    Andrew -

    Wow - I'm glad to see the code is still getting used a year later smile.gif Thanks for tracking down those bugs - I haven't been too active on the embedded front (I'm building a CNC in the shop) www.hubner.net:8080. Merry Christmas to all!

    Paul
Sign In or Register to comment.