Hello. I am a bit lost. I have for the last two days tried to get lua scripts running on ardupilot.
I have tried latest stable fw 4.2.x and latest 4.2 dev (on both plane and copter).
I have tried the above FW’s on 3 different FC boards (3dr Pixhavk1, Pixhawk cube black and Holybro PH4 mini).
I have tried on both a clean install like shown below and on the FC in my Mini Talon VTOL
I have enabled lua scripts and uploaded the .lua files to the scripts folder on the FC (tried both direct to sd-card and through MAVFtp).
I have disabled Terrain and checked that there is enough space allocated for lua scripts (scr_heap_size) and verified that there is enough free memory. All OK as far as I can see.
I have tried different scripts including the the simpler ones like “hello_world.lua” (the one I wanted was the “vtol_quicktune”)
I always get the error (name dependent on what lua I try): “Lua: Error: /APM/scripts/hello_world.lua:8: unexpe”
I have tried to search for this error code without luck. I have a feeling that I it is something easy and stupid I missing, but I am sort of lost…
Thanks for looking into it. What you say sounds a bit strange to me as these are premade scripts from the Ardupulot GitHub, and I have tried 4 different scripts on 3 different flight controllers with the same error message. Hmmmmm.
Post the exact script you are using (drop the file into a post as an attachment). Sometimes the examples are version specific.
If you are using this hello_world.lua, you have done something very strange indeed. There are only 3 lines, and the '<' character appears nowhere. Did you perhaps save the entire HTML contents of a GitHub page? Doing so would result in a file that looks like this, with that exact error on line 8.
That script prints a single message to the GCS and exits. You’re probably just missing the message because you can’t connect the GCS fast enough to see it.