Execute Custom Script At Waypoint

Hello,

My team and I are working on a Arduboat application using the Navio2 shield on the Raspberry Pi 4. We have a separate python script on the Raspberry Pi that executes custom data collection from water quality sensors as well as takes images using the Raspberry Pi HQ camera. We were wondering if it is possible to have Ardupilot execute this script at specific waypoints? After some research, we think the path forward would be to add custom code in the Ardupilot library and recompile. Is there current implementation that we missed? Is there a better way of doing this?

Thanks,
HelloSeen

Yes, ArduBoat 4.0 has lua scripting support that can be used to do that. But ArduBoat 4.1.0-dev has even better support. No need to recompile the firmware, but you will need to write some lua scripts.
Lua scripts examples and lua scripts documentation are available.And you can test it in simulation

I am wondering where the Lua scripts need to be located on the Navio2 in order for them to run? When I set SCR_ENABLE to 1 the APM folder is not created and if I cannot figure out where to create the /APM/scripts folder in order to make them run.