Drones communicate with each other via Lua Scripting

Hi everyone,

I’m experimenting with UAV-to-UAV communication using Lua scripting in ArduPilot.
My goal is to make multiple UAVs share their own location information (e.g. GPS coordinates) through the telemetry network, and then perform some processing logic on that data (e.g. formation control or coordination).

I’ve learned that there are two functions in Lua bindings: mavlink:send_chan()、mavlink:recv_chan()

I’ve already tried running a Lua script on UAV A that uses “mavlink:send_chan(0, 253, “hello”)”, which shows the message on the GCS side, but UAV B doesn’t receive anything when using “mavlink:recv_message()”.My assumption is that UAV B only receives messages with its own sysid, so other UAVs’ messages are ignored.

My question is:
Is it possible to use these functions for UAV-to-UAV communication directly (not just GCS)?
Are there any known examples or limitations of using these functions for direct inter-UAV data exchange?

Thanks a lot!

Have a look at the Plane Follow script for some ideas. There’s plenty of other LUA scripts there too

Look under Applets and Examples

2 Likes