Beginner LUA - flight scenarios script

Hello everyone,
I’m a beginner with LUA, I would like to set up flight scenarios with an LUA script, I have some questions so I can’t find the answers:

  • It is noted in the Ardupilot website that LUA scripts are loaded at Ardupilot startup, so should the script be written from the beginning “Arming” until landing?
  • If this is the case how to manage the arming/takeoff/flight/landing and the variables altitudes, speed, waypoints … for a complete mission with LUA?

I found these functions in the documentation:

  • To be used for ARMING ?

– desc
@return boolean
function arming:arm() end

arm() - Attempts to arm the vehicle. Returns true if successful.

  • To be used for TAKEOFF ?

– desc
@param alt number
@return boolean
function vehicle:start_takeoff(alt) end

start_takeoff(altitude) - Begins auto takeoff to given altitude above home in meters. Returns false if not available.

  • Or is it possible to launch a normal mission in AUTO and then load the script during the flight?
    and it will then be possible to trigger certain specific commands according to a certain time by this LUA script ?

Thanks a lot for your help
Nico

Start here:

1 Like

Thanks Yuri, I don’t know this video, I’ll look at it.

Hi Yuri.

You made me want more F7/H7 boards. :innocent: