Programming drones?

Hi, I want to get started with programming drones and was wondering if any one in these forums can help guide me. I was looking at the dronekit python api on their website, but the links to their forums don’t work.

Is there anything similar to dronekit that is being actively developed for px4 (or ardupilot)

It’s a bit of a vast topic, so difficult to just tell you what to do. Best is if you have a problem to solve, so then the answer can be geared towards that.

I’m a maintainer of MAVSDK which is a C++ library that helps to connect to PX4 via Mavlink. It can run on a companion computer (e.g. a Raspberry Pi) flying on the drone, or on a ground station for scripting.

There are also language wrappers for MAVSDK in Python, Java, Swift, whichever you prefer.

Also, make sure to have a look at the docs:

1 Like

Hi Julian
Thanks for taking the time to respond. I want to program drones for automated missions over forests, to gather data. I was hoping to use Ardupilot as the autopilot software since I have used it before and it’s a very good system, but it doesn’t have to be. I just spent last night reading up on MAVSDK and this seems to be the best option for me, and use px4 instead. As far as I can tell, dronekit isn’t being developed anymore.

Can you tell me would programming a drone with the MAVSDK python wrapper be able to execute scripts as quickly if I did it in C++? I know how to write Python, but I don’t know C++. My concern with using python is that when I have used it before, but in other contexts, the scripts are very slow to execute, which doesn’t matter when I am doing data analysis. But I would have thought controlling a drone it would make a big difference.

It depends what you’re controlling. If you’re just setting position or velocity setpoints in a Python script, it should be plenty “fast” to get you a smooth trajectory. However, if you want to do the attitude or even attitude rate control loop in Python, then it won’t be fast enough. Although it’s not so much Python itself that is too “slow” but rather the fact that there are several levels of indirection between what you run in Python until it’s actually at the drone. Of course it also makes a difference whether the code runs on-board or on the ground station and what sort of latency your link has.