Sending Variables from Mission Planner to Lua Script - 10Hz

Hi everyone,

I’m currently trying to send some variables from Mission Planner to a Lua script running on the flight controller.

Right now, I’m using a plugin in Mission Planner to transmit these variables at a frequency of 10 Hz. My goal is for the Lua script to receive and use these values in real time.

I was wondering:

  • Is there a recommended way to send custom data from Mission Planner to a Lua script?
  • Are there any examples or documentation that demonstrate this kind of communication?

thank you!

I tried the approach in this link: https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/examples/MAVLink_Commands.lua, and it seems to work well.