How to make mission planner to fire event and call our custom sensor control code?

Hello,

I’m planning to make my drone, ship, or rover (with several sensors which are not connected to pixhawk) to move to points A, B, C, D, E, and, at each point, run my custom code to operate sensors and gather data.

So it might move like the following:

start mission → Move to point A → operate sensors & send this data to a remote server → Move to point B → operate sensors & send this data to a remote server → (repeat until the last point) → end mission

I’ve checked MAVLINK API but it doesn’t seem to have API do deal with this sort of mission.

Is there any way to implement this event based (ie: signals to communicate arrived at the location, waiting, and move to next location) mission?

yes, take a look at lua scripting inside the flight controller.

1 Like

Sorry for a basic question. Is Lua scripting running on Pixhawk 4 (filght controller)?
And is there a different language option other than Lua?

Lastly, can this script instruction on the flight controller communicate well with a Rasberry Pi, (which I want to install right next to the flight controller).

Yes, it runs on the flight controller.
No, only lua at the moment.

Yes it can, there are many threads in this forum explaining how to do that.

1 Like

Thank you for the help!

I will look into those threads.