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

  • Hi peter. The cpp is autogenerated using a script I wrote. If the messages are OK it is likely an Error with unloading and reloading the jni lib. Ive only eber tested on the phone thoiugh and witbout the receive thread stopping. If I recall right, receivedbyte is the only incoming function I created.

    I'm away for holidays ATM so I don't have the code in front of me. If you want to send the Java. File I can see if something pops out at me. An error trace would be usefully too.

    Bart.
  • Bart,

    If I start the thread the first time, the decoding is working fine (tested 10min).

    For decoding I use only MAVLink.receivedByte, no other function in this thread.

    If the Thread started again, after some telegrams, I get a error.

    If I use a other function instead receivedByte, I can start & stop the Thread always. There is no problem.

    Could it be, if I close my rs232 & stop the thread, then we have a "unfinished" telegram. And if I restart, maybe a Buffer overflow or anything ?

    Can you descript how i generate the jmavlink.cpp and the header files.

    Thanks

    Peter

  • Hi, Bart.

    The thread is dying, because it's a test function for communication.

    My idea was to create a Thread instate a service. If I need a communication with rs232 (or any other modul)

    then i would start the Thread, and decode with MAVLink library.

    If you are interested, i can send you my project (Eclipse) and you can have a look ? :-)

    I'm a newbee on Java, ok some experience on other dev's.

    Thanks

  • 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 :-)

  • Hi, I use your software with my custom arduplane. I have some other data that I wish to display, I send it as mavlink in throttle, battery %, packet lost. in reality they are rc uplink and downlink rssi and video rssi. Also I have 3 voltages that I wish to see in realtime. I use my cellphone near the video instead of an osd when I don't want to use the notebook. everything is sent by bluetooth, received from frsky telemetry with my own protocol (amazing data rate I wasnt expecting such a speed)

    how can we mod your soft to show them in your android gcs, in hud?

    also do you know what sentence sends the apm status (manual, auto, loiter, etc) because I want to send it but I can't find how.

  • 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

This reply was deleted.