I’ve been trying to solve the problem of using a mouse, touchpad, joystick or whatever device connected to a computer to control a drone.
The drone is running a pixhawk flight controller. In the video showed above, I’m using a rover for demonstration, but it can easily be replaced by a quadcopter, a plane or a boat. In fact the Ardupilot code can handle all these kind of vehicle and controlling it using a computer is easy because they share the same libraries.
So how can I control my drone ?
There is framework called Dronekit, written in Python, that can easily help you interface with your drone through some easy commands:

vehicle = connect('COM10',wait_ready=True)

You can the use the class vehicle to access multiple information like heading, aircraft attitude, and channels values.
So I connected the flight controller through USB to the companion computer, in the videao, I’m using the Nvidia Jetson tx2. Very tiny , the size of a credit card , yet very powerful computer.
But how can I wirelessly send command to the drone ?
I installed a web based server in the Jetson, using flask. Flask is a perfect framework for this type of application because it is written in Python and the setup of the server can be done in less than 5 minute.
So when you connect to the Jetson webpage, the website reads the value of your joystick using a gamepad javascript API:

function reportOnGamepad(event) {
var gp = navigator.getGamepads()[0];
var html = "";
html += "id: " + gp.id + "

for (var i = 0; i < gp.buttons.length; i++) {
html += "Button " + (i + 1) + ": ";
if (gp.buttons[i].pressed) html += " pressed";
html += "

for (var i = 0; i < gp.axes.length; i += 1) {
html += "Stick " + (Math.ceil(i / 1) + 0) + ": " + map_lol(gp.axes[i]) + "," + "

var data= {
'throttle': map_lol(gp.axes[1]),
'yaw': map_lol(gp.axes[2])

We can see in the code above that the value of throttles and yaw are being sent via Ajax back to flask to be interpreted as a python command:

Back in Flask, you can retrieve those value using this piece of code:

@app.route('/clear_override', methods=['GET','POST'])
def rc_override():
data = {}
data['rc_values'] = request.json['rc_values']
data['yaw'] = request.json['yaw']
vehicle.channels.overrides = {'1':1500,'3':int(data['yaw'])}
vehicle.channels.overrides = {}
return jsonify(data)

And that’s how your command your drone via a web browser. Pretty cool… but wait there is more you can. let’s say you have a 4G pocket wifi. That means you can command your drone from anywhere as long as you have an internet connection. Check this out, we did this at work (sorry for the vertical video):

I have repo with all of the program:


please comment, I would make it clearer for those who need for information about this.