#4 XTE: cross track error

Hamish B


Expanding on the nice new "draw line to target" option..

It would be nice to include the ability to show cross-track error on the dashboard, similar to the existing "Turn" Left/Right.

It tells you how much you have strayed from the route line; important if you are trying to exactly follow a route.

A route would need to be on-screen, and the program would have to know which leg of the route it was on and what the next "waypoint" is (I use wpt == route vertex here). I would suggest to take the next "wpt" by user setting the target cursor within (e.g.) 10 pixels of a route vertex, and then chose which of the (up to) two legs of the route you are on based on proximity to the far end of the leg.

From there it is just some simple trig:
XTE = dist_to_target * sin(diff between bearing vs ideal)

by knowing the two ends of the route the bearing of the route-leg can be known. (easily in a cartesian sense, not so much for great-circle..)

If target cursor is not near a route vertex, XTE is displayed as "--".

Sometimes the GPS (usually GPS/autopilot system) will output the next waypoint (nmea: $GPWPT) and XTE ($GPXTE), but that requires two way communication with the GPS and a GPS that can handle it. Grep for "XTE" and surrounding messages in Documentation/NMEA.txt for more about that and left/right conventions (reuse whenever possible).



  • Hamish B

    Hamish B - 2008-10-28

    It seems for the voice stuff that GpsDrive already knows about which leg of the route you are on and what the next waypoint is. So the hardest part is already done and all that is left to do is the presentation.


  • Hamish B

    Hamish B - 2009-01-15

    some framework code now added, but more to do.
    (hint: look at voice code)


  • Hamish B

    Hamish B - 2009-01-16

    nope, voice code just calculates Turn angle. it doesn't know about route-legs.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks