ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

GCS position in LUA

Open twistedwings opened this issue 1 year ago • 3 comments

Some GCS (at least QGC) send their position via MAVLink GLOBAL_POSITION_INT message. The idea is to persist the position of the GCS and make it available in LUA. That would be very handy for many use cases, e.g. quickshots.

twistedwings avatar Oct 01 '24 10:10 twistedwings

You can receive MAVLink in scripting so you could track it "manually".

IamPete1 avatar Oct 01 '24 15:10 IamPete1

yeah, that might work. But seems kinda low level.

twistedwings avatar Oct 01 '24 15:10 twistedwings

I have written a lua script witch parses the GLOBAL_POSITION_INT message. It works very good.

However it would be so much nicer if ArduPilot did this. The message is already being parsed so it shouldn't be too much effort to persist the position.

twistedwings avatar Oct 18 '24 20:10 twistedwings

There may be more than one other "vehicle" on the network.

LupusTheCanine avatar Oct 21 '24 20:10 LupusTheCanine

There may be more than one other "vehicle" on the network.

Each vehicle/GCS should have a unique SYSID_THISMAV - each MAVlink message identifies the SYSID that it came from. QGC defaults to sending as SYSID 255, but it can be changed in Application Settings.

timtuxworth avatar Oct 21 '24 20:10 timtuxworth

Do you mean how to identify the GCS ? I think the only way is to check compid for MAV_COMP_ID_MISSIONPLANNER (190). Because the sysid of the GCS could be any value although it is 255 in most cases.

twistedwings avatar Oct 22 '24 02:10 twistedwings

Do you mean how to identify the GCS ? I think the only way is to check compid for MAV_COMP_ID_MISSIONPLANNER (190). Because the sysid of the GCS could be any value although it is 255 in most cases.

There may be more than one MAV_COMP_ID_MISSIONPLANNER on the network.

LupusTheCanine avatar Oct 24 '24 13:10 LupusTheCanine

A solution might be to filter the sysid by SYSID_MYGCS.

twistedwings avatar Oct 24 '24 13:10 twistedwings