Is this possible to invoke the method of QGroundControl from a Django(Python) web application?

184 Views Asked by At

I have a Django web application hosted on Ubuntu 18.04 and on the same machine I have installed the QGroundControl.

In my Django Web Application there are two buttons (Take Off & Return to Land).

Is this possible that when I press the Take Off button from my Web Application, it should invoke the Take Off method of QGroundControl?

How can I connect the Django (Python) Web Application & QGroundControl?

There will be some API or Web Service etc? Any idea?

1

There are 1 best solutions below

1
On

I am not using QGroundControl. However, from a quick look at the doc, I think the most straightforward way is to compile your own version of QGroundControl to add a remote control feature. It's open source and the code is available here.

If QGroundControl does not need to be running all the time, you could modify it to accept command-line arguments to request take-off or landing. These commands could then be launched by Django using the subprocess module.

If QGroundControl needs to be running all the time, you could change it to run a socket server, to which you could connect with a Python client, or in your case some Django code. See here for a (very) minimal example.

If all this looks complex to you, you can always ask QGroundControl developers for a feature request to run a control server with the software.