RX Delay Interrupt

Hello. It’s necessary to interrupt delay in mission (APM 2.8) by signal from Arduino, i.e. vehicle moves to the waypoint, vehicle starts to do smth by Arduino code, mission planer’s delay starts, and when Arduino code is ended, vehicle should ignore the remaining part of delay and move on. Is there any way to achieve this? Thanks.

Ok so first of all, you’re using an unsupported board, I changed the tags.
I couldn’t be able to understand what you are trying to achieve.
Please explain in details.

Vehicle moves to the waypoint. It’s necessary to do operations by arduino’s code (this operations does not relate to Ardupilot) in the waypoint (by do_set_relay comand arduino will start it’s work), but operations from code can take unknown time. It’s possible to use big delay after do_set_relay, so operations in code will be taken, but vehicle will waiting remaining part of delay in the waypoint. I try to achieve that arduino will sent signal to APM when arduino’s code is ended and delay will be stopped. Sorry, English is not my native language.

you can send mavlink commands from an Arduino while your Arduino code runs. MAVLink and Arduino: step by step

I dont recommend this, you should just get a f4 based controller and use lua from there. this is a unsupported and untested.

2 Likes

Or better, you can do what @geofrancis said for fully aware of the vehicle at the arduino side.

You should communicate with MAVLink and through a serial connection as said in the topic.
After that, you can create a mission with unlimited loiter waypoints.
When you’re done at the Arduino side, just send MISSION_SET_CURRENT to the vehicle from arduino with seq is the next waypoint index.

1 Like

Thanks a lot. If you could say where I can study Lua scripting for f4? I can’t find smth useful.

https://ardupilot.org/copter/docs/common-lua-scripts.html

1 Like

Make sure it’s not a Feature Limited board like many F4’s are:

Feature Limitations

Go with an H7 board, it’s future proof.