As a by-product of a research I’m working on right now, I’m showing this videos of me controlling a multirotor from a computer. Its done in different multirotor platforms, two flight controllers, Pixhawk and MultiWii.

So, the basic idea is to send data to the companion computer and then the companion computer will use it to several purposes. The purpose of this post is to send roll, pitch, throttle and yaw data to the flight controller. In other words is to fly the multicopter from a computer. Eliminating the need of a standard RC radio, you might ask, why do I want to this?? there is three ways to answer this, one is because I can… the second one is to ensure the communication with the vehicle is working great and its robust, and the third one is to afterwards develop advanced outer-loop position controllers.

This is by no means new or cutting edge, is just clever use of the libraries I have written (in the case of my multiwii library…) and the one that has been developed by people from 3DR (dronekit). The source code for this joystick example is here.

The companion computer used in this tests is a creditcard-size computer, the popular Raspberry Pi 2, which has four cores clocks at 900mhz and has 1 gb of RAM.

The companion computer is running linux and some python scripts (I’ll explain more later…), the ground station is running Matlab/Simulink in order to read the joystick and motion capture tracking system (not used in this examples…) and then just sent via UDP to the raspberry pi.

For the pixhawk video above, I first want to make a recommendation related to this flight controller, don’t buy the Hobby King clone version. We wanted to “save” money by buying this clone version and now we have 2 controllers that are not working… we might just had bad luck with a bad batch but who knows… Buy the original 3DR one.

The pixhawk is connected to the raspberry pi using serial communication, a tx/rx/gnd cable, we are using serial port 2 on the pixhawk.

The baudrate on the rpi is limited to 115,200… But for our requirements is still working ok. When we need more speed, we will need to modify the kernel or change from raspbian to ubuntu…

The rest of the multirotor remains the same. GPS is connected, but being inside a building, there is no way to get GPS lock. But no worries we have a very precise indoors GPS system… Which is a motion capture system. In the pictures you can see a GPS stand being used for the optitrack markers, the overall tidiness of the vehicle is truly amazing.

The firmware remains untouched, we are using 3.2 and 3DR flight stack, we might change to PX4 flight stack, but so far, this one is working ok. The only thing that we have changed on the pixhawk is the parameters of the SR2 rates. Apparently the maximum value we can assign is 10hz… we might need more.

DroneKit makes doing apps/scripts and in general talking to the pixhawk a very easy task. I want to thank Andrew Tridgell and all the developers involved in DroneKit.

On the multiwii side... I have done this one in the past, in several forms and with different boards, but in this test I’m using a naze32 board, which is the great because is 32bit which means is faster and the stabilisation is smoother, and of course the communication is way way faster than my old 8bit versions.

I have actually achieved 300hz of communication using a oDroid U3… Check this video.

This library performs great, is lightweight and extremely easy to use. https://github.com/alduxvm/pyMultiWii

The code for this example is here. The result is here:

Both codes are fairly similar and perform in almost the same way, there is tons of applications we will start doing using motion capture systems, on board cameras etc etc...

Views: 2409


Moderator
Comment by Roberto Navoni on August 24, 2015 at 4:47am

I did same test but with my taranis used as joystick connected to drone by router . with HD realtime video trasmission. i used micro brain connected to VR Neuron II our companion computer based on RPI2 CPU

Best

Roberto 

Comment by Aldo Vargas on August 24, 2015 at 5:14am

Awesome!!

are you also sharing code? do you have a blog or something with more in-depth information?? whats the baudrate?? dronekit? ros?? px4 or apm?

mine is here: http://aldux.net/blog/flying-from-computer/


Developer
Comment by Tom Pittenger on August 24, 2015 at 12:51pm
Comment by Martin GW on August 24, 2015 at 2:37pm

Very nice Aldo, so you are updating at a few hundred Hz? that is much faster than any RC system. 

Roberto, what about lag? can you FPV with it?


MR60
Comment by Hugues on August 25, 2015 at 12:14am

Nice. Why did you use a RaspPi instead of a Odroid XU4? You'd have more brute force !

Comment by Aldo Vargas on August 25, 2015 at 12:47am

Thanks a lot!

@Hugues we actually have them and we are using them with ros, but our U3 and XU4 are not ready to fly, maybe in a week or two ;)

Comment by heshubao on September 18, 2017 at 9:03am

Hello, I want to send mocap data to PX4 with dronekit, but the mavlink att_pos_mocap massage confused me , I don't know how to it ,can you explain this ,thank you very much.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service