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).
Log in to post a comment.