yaapu / FrskyTelemetryScript

A LUA telemetry script and widget for the Horus X10(S),X12 and Taranis X9D+,X9E,QX7 and X-Lite radios using ArduPilot frsky passthru protocol
GNU General Public License v3.0
431 stars 136 forks source link

Total distance calculation based on actual UAV position #183

Closed booo closed 1 year ago

booo commented 1 year ago

Is it possible to calculate the total distance traveled based on the actual UAV positions? Do we receive the UAV position via the telemetry data? Or do we need an additional script or something on the FC as mentioned here.

The current calculation differs from the calculations done by e.g. QGC quite a lot for flights longer than e.g. 50 kilometers.

yaapu commented 1 year ago

Yeah, I agree, the calculation is pretty basic :-) I can switch method and use sampled gps distance, I can sure improve it, nobody actually bothered to ask for a better implementation, would you be willing to test it?

yaapu commented 1 year ago

Switching to haversine I've got an error of 200m on a 75Km flight, should be good enough (reference is ArduPilot OSD which is updated at 10Hz)

booo commented 1 year ago

That sounds great. We can test the implementation on one of our next test flights for our project.

Thanks for taking the time to implement a better solution!

yaapu commented 1 year ago

hi, please try latest master

booo commented 1 year ago

Sorry, this slipped through. We will do tests in the next weeks. Thanks for your work!

befut8 commented 4 months ago

did you had a chance to test ?