Distance from home

Is there a Mavlink message that gives the distance from home or must it be calculated from the Home and Current Position Latitude and Longitude

David Ardis

There is none but you will probably find it easier to use Pythagoras + the contents of MAVLINK_MSG_ID_LOCAL_POSITION_NED to get the straight line distance.

Hi @arduouspilot
I looked into the MAVLINK_MSG_ID_LOCAL_POSITION_NED however I only see one set of x,y,z position.
firstly I am not sure if this is the home or current position.
secondly I need both of the above, where do I get them.

edit: this is the message.
/*
MAVPACKED(
typedef struct __mavlink_local_position_ned_t {
uint32_t time_boot_ms; /< Timestamp (milliseconds since system boot)/
float x; /< X Position/
float y; /< Y Position/
float z; /< Z Position/
float vx; /< X Speed/
float vy; /< Y Speed/
float vz; /< Z Speed/
})
*/

Thank you
Nimrod

It is the current position.