lua returned bad result error in ArduPilot

I keep getting this error. I don’t know lua scripting so I got this script from AI but I need it to work. I asked AI this:Write a function that will work in mission planner ardupilot for a waypoint mission. The mission will start with AUTO mode. The function should start when the plane reaches waypoint 3 and after that it should change the mode to GUİDED and make the plane go to 35 m altitude with -45 degree pitch. After reaching 35 m altitude, the plane should climb to 100 m altitude and continue flying in AUTO mode.

Can you help me with this error?

mission18.lua (5.8 KB)

Welcome to Ardupilot @mlskskbs

AI makes good doctors better and bad doctors worse.

Why would you want to interrupt auto mode during the climb to 100 metres, when you could do it directly with auto mode?

Rolf

3 Likes