Copter-GCS now supports MAVLink


At long last, I finally beat MAVLink into Java submission. I wasn't able to find any MAVLink bindings for Java (needed by android), so I ended up using JNI and wrote a MAVLink wrapper. It works nicely and makes using MAVLink very easy. Its available for download here. I've included both the "common" and the "pixhawk" messages.


As you see above, I've added a HUD mode.


I've uploaded the new copy of the GCS for easy download or through the Android Market (search copter-gcs). Of course the source is available through SVN

I am focused on Copters, as that is what I fly, but with MAVLink support, the copter-gcs is now also useful for ArduPilotMega. I loaded the APM code on my quad (minus the props :-) ), and was able to see / tune track just fine with it. The only thing missing is that the PID tuning widgets I have are currently only setup for the copter. The next version I expect will have the APM pids added in. For now you can just use the Parameters view to set anything you like:


3689415780?profile=originalWhen you make a change, just hit the button next to is to save it.

That's about the news for now. I will be working on Mission Planning and some clean-up next.


If anyone has any problems, let me know. Same thing if there is a feature missing (no promises though).

So far USB host mode for tablets (connect XBee directly) and Wifi links have been requested, although i'm not sure when/if they will make it in.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Hi,

    I am new in this branch, so sorry for my mistakes

    I try to use your app but it crashes when it try send data to copter

    code looks good, mavlink is ok (I think so), android device is Nexus S ...

    what confuse me, that AqGcs app works properly with my copter

    What you think? issue connected with MavLink or did I do something wrong?

    Best Regards,


  • Hi Bart,
    First of all congratulations for your very good job.

    Last days i have been testing Android x86 (Ice Cream Sanwitch) in my Acer Aspire One D150, it seems to work very well, the work haven't finished yet beacuse the spansh keyboard isn't completly funcional but is not a problem because the screen keyboard has not problem.

    After that preamble I would explain my idea.
    I would like to use your aplication in the NetBook with ICS as GCS conecting to APM2 througt 3DR Radio connected by the USB port in the NetBook.

    The version of your aplication that i have tested complain about the USB connection when I try to configure.

    Reading the post I see that the USB suport is desabled.
    Do you have a prevision for a working USB support?
    Do you think is possible to use my proposed scenary?

    Best regards,

  • As a follow-up to my previous post, the solution to the problem I was facing was to change the arguments of the jni FindClass functions in jmavlink.cpp and classLoader.h to match the description of the function argument: name: a fully-qualified class name (that is, a package name, delimited by “/”, followed by the class name). As such, the code must change from:

    interface_class = env->FindClass( "com.MAVLink.Messages.IMAVLinkMessage");

    heartbeat_class= env->FindClass( "com.MAVLink.Messages.common.msg_heartbeat");



    interface_class = env->FindClass( "com/MAVLink/Messages/IMAVLinkMessage");

    heartbeat_class= env->FindClass( "com/MAVLink/Messages/common/msg_heartbeat");

    I don't know why the code in the repository works, but it has probably to do with the way android packages it's programs.

  • @Jani,

    The correct protocol is MAVLink using version 9 on arducopter 2.6.

    Someone has tested the app for me using MAVLink 1.0, but I cannot do so myself yet, as I am still flying a 1280 board. Work is crazy for the past and next few months, so although at some point I will test it all (and have time to fly again), it might be a while.



  • Hi,

    What is correct Protocol with latest copter-gcs-9-packed.apk and arducopter 2.6? I can only use MAVLink -protocol and with that i have huge lag in HUD screen. Arducopter1 -protocol crashes copter-gcs soon after searching Heartbeat, is this normal?

    My setup works well with MissionPlanner1.0 so i think it's ok.

    Regards Jani

  • Hi Dries,

    Yes, I know this problem. But I didn't found a solution.

    I think something goes wrong in decode function.

    But for this is no source avalible, so I moved to qt + qgroundcontrol.


  • To be honest, I have only ever used the library on android, building it using "ndk-build" in the android NDK. I haven't touched it in awhile though. I've not had this build error come up before.


  • I'm trying to compile and use JMAVLink on Linux x86, but I'm stuck... 

    I use the following command to compile jmavlink.cpp:

    g++ -fPIC -I./mavlink -I/usr/lib/jvm/jdk1.6.0_31/include -I/usr/lib/jvm/jdk1.6.0_31/include/linux -g -c jmavlink.cpp

    Then I create a shared library using:

    g++ -shared -o jmavlink.o -lc

    When using this library in combination with the JMAVLink java sources (, I keep on getting the following runtime error:

    Exception in thread "Thread-3" java.lang.NoClassDefFoundError: com.MAVLink.Messages.IMAVLinkMessage
    at com.MAVLink.MAVLink.init(Native Method)
    at com.MAVLink.MAVLink.<clinit>(

    Peter, Bart, do you have any suggestion? Could this have anything to do with a dependency on libstdc++?



  • Hi Bart,

    It seems that I have some problems with Thread-Safe function.

    Are you interested on my code? Then I will send it to you, Maybe you have a idear.

    Thanks Peter

  • Bart, for the moment, I let the thread running and close the comport, and let the Thread sleep a liitle bit.

    I think this should working.

    Now I would compile the JMavLink for Linux, for Windwos it is working.

    Do you have a syntax for compiling the library with g++/gcc ?



This reply was deleted.