Moderator

Some MAVLink Protocol Notes

3689514863?profile=original

Here's some notes on fiddling with MAVLink.  Andreas and I started at the bottom of the stack (the byte stream) and are working our way up.  Along the way I filled in a few possible holes in the documentation.

http://eastbay-rc.blogspot.com/2013/04/mavlink-protocol-notes-packet-decoding.html

There's a demo of one process receiving an APM MAVLink stream, decoding packets, and multicasting the packets to other processes, sort of an on-the-cheap message bus.  There's a link to the sample code.

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Developer

    Just an update:

    The mavlink code from DroidPlanner has been separated in a new library, so it's easier for anyone who wants to use it (and possibly contribute upstream). Here it is:

    https://github.com/DroidPlanner/jMavlink

    One nice thing is that it's based on the "official" mavlink generator, and we will probably be submitting a pull request to merge with the official project.

  • Hello guys

     

    i have yet a Java implementation for Mavlink :

    https://code.google.com/p/mavlinkjava/

    It works fine on Android, Windows, Linux and embedded Java in drones.

    Have fun!

     

    Guillaume

  • Developer

    @Manuel:

    Contact me via email or PM so I can help you more directly.

    To develop DroidPlanner you will need an android device. The Google MAPs API doesn't run on the emulator, and the same is valid for the USB port.

    Please go trough the first steps in the android developers site. They will explain you better than me, and that way we both save time. When you get your first app running on the device contact me. The link is:

    http://developer.android.com/training/basics/firstapp/index.html

  • Arthur,

    I wanted to try your implementation in the droidplanner but I have never developed anything for Android.  How can I get Gloogle Maps API key? That seems to be the problem I am having when I try to run the app on the emulator.

    Thanks,

  • Developer

    @Andreas: Thanks for the tip. I wanted to rewrite the parser on Droidplanner (I have written it when i was just starting to learn java), I just haven't got the time yet. There is an issue here: https://github.com/arthurbenemann/droidplanner/issues/15.

  • @arthur.benemann, being a Java guy I really like your implementation, very clean and easy to understand. Great that the Mavlink functionality is 100% separate from the Android specific code.

    One small tip for the MAVLinkPayload class. The ByteBuffer actually can be set to support LITTLE_ENDIAN to make the parsing the binary data even simpler:

    ByteBuffer bb=ByteBuffer.wrap(payload);
    bb.order(ByteOrder.LITTLE_ENDIAN);
                    
    System.out.print("param_value: "+bb.getFloat());
    System.out.print(" param_count: "+bb.getShort());

  • Moderator

    Matthew, good question... right now it's mainly a learning exercise.

    - mavproxy does the hard stuff for you, so there's a temptation to skip over the hard stuff.

    - it wasn't particularly obvious (at least to my level of brainpower) how to get started with mavproxy stuff.  Now that we understand the lower levels, it's a bit more obvious what's going on.

    - Andreas and I both like "message bus" style protocols, and multicasting is a convenient way of implementing such a thing quickly and without requiring lots of additional libraries.  One nice feature of message passing is that it makes it easy to integrate modules written in different languages, since the only interface is the well-defined message protocol.

  • Please excuse my ignorance but what is the difference between this and mavproxy?

  • Moderator

    Thanks Arthur, that's some good work on DroidPlanner.  I'm going to buy an android tablet just to use it! 

  • Developer

    If someone would like to take a look on my implementation on Java:

    https://github.com/arthurbenemann/droidplanner/tree/stable/Mavlink/...

    Sure there is a lot that can be improved, but it works nicely on DroidPlanner.

This reply was deleted.