Let’s say the drone is going from waypoint A to waypoint B in a straight line.
Naturally, the drone doesn’t stay perfectly straight on the line.
Is there a way to show the distance it is off by in real time during the mission?
I believe this is called the cross track error.
Alternatively, is there a way to get info on the previous waypoint and next waypoint?
I read the post on Lua scripts here Lua Scripts — Copter documentation but it only mentions getting the home waypoint.
To display the cross track error in real-time during a mission in ArduPilot, you can use the Mission Planner’s Flight Data screen. The cross track error, which indicates how far off the vehicle is from its planned path, is shown on the Heads-up Display (HUD) as part of the telemetry data. Here’s how you can view it:
Connect your vehicle to the Mission Planner.
Navigate to the Flight Data screen.
Look for the cross track error indicator, which is typically displayed alongside other telemetry data like airspeed, heading, and altitude.
In case anyone needs this info in the future.
You can make it show up on the dashboard (Quick tab) by selecting xtrack_error.
Also you can get it in Lua script with vehicle:get_wp_crosstrack_error_m().