Re: [QGroundControl] MAVLink Java Generator

180 views
Skip to first unread message

Meier Lorenz

unread,
Sep 19, 2012, 7:48:28 AM9/19/12
to qground...@googlegroups.com, mav...@googlegroups.com
Hi Guillaume,

Congratulations, great to hear!

Could you send me a ZIP file of your current state and I'll check how this could be integrated in the current main MAVLink generator repository.

Thanks!

-Lorenz

On Sep 19, 2012, at 1:46 PM, Guillaume Helle wrote:

Hello all!

I just finish my MAVLink Java Generator!


Command line arguments are :

*
source : directory path containing xml files to parse for generation
*
target : directory path for output Java source files
*
isLittleEndian : true if type are stored in LittleEndian in buffer, false for BigEndian
*
forEmbeddedJava : true if generated code must use apis for embedded code, false else
*
debug : true to generate toString methods in each message class

Example :

*
java org.mavlink.generator.MAVLinkGenerator resources/v1.0 target/ true true true true

Generate MAVLink message Java classes for mavlink xml files contains in resources/v1.0 in target diretory for Little Endian data, embedded code with debug code.



It is architectured with 3 Eclipse Java projects.

org.mavlink.generator : contains the generator and MAVLink xml files. Generated code is put in org.mavlink.library/generated folder.

org.mavlink.library : Helpers for MAVLink and message. Contains generated code from generator.

org.mavlink.util : CRC classes uses by generator and library.



After code generation, 2 jar descriptors in org.mavlink.library and org.mavlink.util projects can be used to generate jars for your application...



I have 2 solutions for code repository :

I create a google code project

I host it in MAVLink project



All comments are welcome! :-)

I can send zip archive for beta testers...



Have fun!



Best regards



Guillaume Helle

--




Guillaume Helle

unread,
Sep 25, 2012, 1:38:52 AM9/25/12
to qground...@googlegroups.com, mav...@googlegroups.com
Hello Lorentz,
 
i have had readme files and add/corrct some code...
Do you want i add cmake file to build the Java part? or ant file?
For the next it will be easier if i can commit no?
 
Best regards
 
Guillaume

Bryant

unread,
Sep 25, 2012, 9:04:19 PM9/25/12
to qground...@googlegroups.com, mav...@googlegroups.com, Guillaume Helle
Would it not make more sense to roll the generator code into the
pymavgen? That way the generator is all in one code base for Java, C,
and Python.
> --
>
>
>

Guillaume Helle

unread,
Sep 26, 2012, 5:09:07 AM9/26/12
to qground...@googlegroups.com, mav...@googlegroups.com, Guillaume Helle
Hello Bryant,
 
yes, the best place for the Java generator is in MAVLink distribution... :-)
But i don't know python so the generator is writen in Java...
So it can be launched by gen_all.sh...
But i must generate code for Little/Big endian, Embedded or not, debug or not and mavlink version... so the result is a lot of jar files...
 
I must rewrite too my MAVLinkReader class to check sequence and to be not blocked on reading streams...
 
Best Regards
 
Guillaume

Bryant

unread,
Sep 26, 2012, 2:11:20 PM9/26/12
to qground...@googlegroups.com, Guillaume Helle, mav...@googlegroups.com
I just wanted to bring this discussion up before this code went too far as to whether it makes sense to add a separate generator to the MAVLink project that's written in Java. That means there will be two separate generators for MAVLink. Any changes to the protocol then need to be done twice. Also the Java implementation isn't finished. It seems like since most of MAVLink generation is merely text copying, it should be fairly easy to move your work into pymavgen instead of leaving it separately. Of course, since you don't know Python, that will make things more difficult as someone else will need to step up to the plate. I'm of the opinion, given the number of developers for MAVLink, that adding a Java port will be unmaintainable in the medium- to long-term.
--
 
 
 

ghelle

unread,
Oct 11, 2012, 9:32:11 AM10/11/12
to mav...@googlegroups.com, qground...@googlegroups.com, Guillaume Helle
Hello all,
 
i have attached my first version of the MAVLink Java generator and library at this URL :
 
You can unzip it directly in pymavlink\generator directory.
 
At this time i have only wrote a windows command file to build and generate all and you need Ant for Java build...
I am working on a shell version using Ant too...
I have already generated all jar files in lib directory...
Documentation has been generated whith Doxygen...
 
i am very interested for any request, suggest or remaks...
Reply all
Reply to author
Forward
0 new messages