Copter-GCS now supports MAVLink

3689415633?profile=original

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

Comments

  • As another thought: more importantly, why is the thread dying? That shouldn't really be happening for your receiver...

  • Hmm, it sounds like it it creating a new object. Init is the constructor. Perhaps a message is received that is not included in the current jMavlink Library? Does it work with copter-GCS?

  • Hi Bart,

    I can now decode MAVLink, with a dll.

    But I have some Problems.

    I have generate a thread, there i call MAVLink.receivedByte.

    This work's for the first time. If the thread ended, and I reconnect, after some Messages I get a

    exception like

    java.lang.NoSuchMethodError: <init>

    Hmm. Maybe you can give me a hint :-)

  • Bart,

    now I have compiled the library, and the LibraryLoad works :-)

    Compiling the library (with Windows) wasn't easy.

    In some days I can say a little bit more.

    Thanks Peter

  • @Peter: Sry for the delay, I just moved. I have never tried JNI outside the android, but if I get a chance, I'll look into it. PM me some details about what you are trying to do (if you are still looking at it) and we can go from there. The only real thing you'll have to do is compile in the library, the rest should be fairly obvious from the phone apps' code (particuarly the main service).

    Cheers.

  • Hi Bart,

    First off all, perfect work. Very nice app.

    I want use your MavLink implementation for a Java windows application.

    I'm a absolute new to jni, maybe you can help me to generate a library?

    Thanks

  • Yes. If you get a bluetooth modem, you can put it right on the quad and it will work.

    As that post suggests though

    "Although these modules are 3V, they will work with the 5V APM, so long as there is at least a 1K resistor on the RXD (which is what the 5V TX line on the APM will drive). The 3V signal from the module to the APM is OK as it is."

    Once that is satisfied, you can connect directly. Just swap the RX and TX wires.

    Cheers,

    Bart.

  • There is an experimental copy of the code in SVN which attempts to access an XBee module attached through USB host mode on Android 3.0+ tablets.
    It allows selection of the USB device, opens it, and is tied in to send/receive data just like a bluetooth connection. However, it doesn't actually work...

    It appears USB host mode does not currently support USB->Serial converters, as the kernel module for it is not loaded.
    Once a kernel module is made available (by default, and not through hacks) which supports FTDI chips, I will revisit this code and bring it into the main branch.

    A big thanks goes to Jeff E (on the DIYDrones site) for repeatedly running the code for me on his tablet.
    With the logs he collected I was able to write enough code such that when USB->Serial is supported by the Android OS, the app will quickly be able to support it also.
    The posted code wouldn't have gotten there without his help. 

    If anyone has leads on how to make android / USB Serial work, please let me know!

  • Glad you got the debug figured out. Unfortunately you'd have to capture the log when the app actually crashes, as this doesn't actually capture anything related to copter-gcs. If you are still interested in figureing this out, let me know. However, I noticed that you are putting your tablet up for sale...

     

    I would still like to know why its crashing though, as its currently the only report. If someone has crash trouble, please let me know so it can be fixed.

  • Moderator
    For Sale: Acer Iconia A501
This reply was deleted.