Shop OBEX P1 Docs P2 Docs Learn Events
GPS Utilities: Calculate distance and bearing using Haversine method — Parallax Forums

GPS Utilities: Calculate distance and bearing using Haversine method

Chuck RiceChuck Rice Posts: 210
edited 2008-04-14 23:21 in Propeller 1
I needed distance and bearing calculations for my robot, so I created a new object that
calculates these. See the comments for example calling sequence. The
commLink.cprintf(...) calls are calls to multiCallSerialDebug from the object
exchange. They are not needed by the object, but I use them for debugging.

Post Edited (Chuck Rice) : 4/11/2008 12:40:58 PM GMT

Comments

  • Goran (Sweden)Goran (Sweden) Posts: 68
    edited 2008-04-11 07:25
    Chuck
    If you go to File>Archive>Project in the Propeller tool, it will produce a ZIP file which have your complete project to attach.

    It is from my point of view the best way since the file will include everything needed to run.

    No need to look for:
    obj ''Requires the following objects from http://obex.parallax.com/
    fp : "Float32Full" '' Requires 2 cogs
    fs : "FloatString"
    Format : "Format"
    link : "MultiCogSerial" 'allocates 1 cog
    G : "Globals"

    Regards/Goran (Sweden)
  • Chuck RiceChuck Rice Posts: 210
    edited 2008-04-11 12:40
    Thanks Goran. That worked! I edited the first post and added the attachment.
  • Paul_HPaul_H Posts: 85
    edited 2008-04-14 01:16
    Chuck,

    Looks good! I've been moding /adding to the GPS programs as I find them and am planning to post the results too. Between you, Perry, MK and me , I think we have about enough for a general purpose GPS + navigation library! Nice job.

    Paul
  • Chuck RiceChuck Rice Posts: 210
    edited 2008-04-14 23:21
    I think that it would be great to merge the GPS functions into a set of objects. I made the utilities a separate object because the calculations required full floating point and that requires 2 COGs. Maybe we could put all the things that require FP into that object and the integer only stuff into the other? Or is there a better way?
Sign In or Register to comment.